I'm trying to build the clone layout of wechat. But I not able to make build the correct alignment for the children inside of Horizontal Layout. The parent of the horizontal layout is ScrollView.
The video link below shows the effect I get for now. The avatar should be fixed. I did tried to apply some others Layout but it's not working very well for me.
https://drive.google.com/file/d/16nSz6x-Ojh_GqrnWFKdJwbYSZ396g8CP/view?usp=sharing
That's happening because your UI anchors are on incorrect position. You need to understand the UI anchor system of Unity first. Take a look at this official article here.
Related
I'm trying to replicate Instagram's zoom feature on their list of videos on iOs using xamarin.forms.
I have a xamarin.forms ListView (actually a modified FlowListView) and I've been successful for the most part except for the fact that when I'm zooming, the zoomed view (an AVPlayerViewController) zooms fine but cannot extend beyond the size of the cell that contains it so it gets clipped. The effect is achieved by a simple UIPinchGestureRecognizer and UIPanGestureRecognizer and applying the appropriate Transform/Scale using CGAffineTransform.
You can see the problem here
From what I understand, the clipsToBounds property is what keeps views confined to their parent's frame so I tried:
setting clipsToBounds to false (even though that's supposed to be the default value) in the renderer and recursively to all the views' .Parent properties.
setting it to false in the default ViewCell renderer.
setting Xamarin's IsClippedToBounds to false at the xaml level.
Instagram also seems to blur the background of the zoomed video (as it is being zoomed) which would indicate that they've somehow moved the video view out of the cell and into some other temporary fullscreen view.
So I'm looking for some general guidance; is my understanding of clipsToBounds wrong? What is keeping the view from being drawn outside of its UITableViewCell? Should I approach this from a different angle? I'm at my wits' end, thanks in advance.
I am having trouble removing what I think is the margin, padding or scroll from the xamarin.ios framework. As you can see from the gif below, when I scroll up or down the whole view seems to move. How can I prevent the user from being able to scroll the UIWebView element (if that is what causes the problem) away?
Use the following code
webView.ScrollView.Bounces = false;
I'm working on a project using wpf.
The UI design is based on a tile system, where you can drag and drop tiles to specific locations.
The presentation of the tiles uses a customized TreeView that renders the items as Grids.
looking close to the rendered grid items i recognized that wpf renders the grid with shadows on the left and the right side.
Does anyone have an idea why there are shadows rendered? For a specific feature i have to color the bottom part of the grid red and it looks awkward cause of the rendered shadow.
Late to the party but for someone with same issue which seems to be the result of using Effect in the application like DropShadowEffect It solved my issue by adding following line to the Grid/Border ...
UseLayoutRounding="True"
I have seen lot of posts which demonstrate how to move objects in a Canvas but what I need is, a way to move either
1. the entire canvas along with its every child
or
2. move every object manually (which is certainly not advisable)
I have put my Canvas in a ScrollViewer.
My actual issue is : I m trying to zoom the canvas using ScaleTransform but after zooming, i also need to move the scroll viewer to a point such that the clicked point is at the center after zooming.
I tried Canvas.SetLeft() and Canvas.SetTop() but bad luck..
Any idea?
Thanks in Advance..
You can communicate with the ScrollViewer to make it scroll its content to a particular offset by using ScrollToVerticalOffset and ScrollToHorizontalOffset.
You'll need to calculate the correct offset by taking into account the size of the "viewport" i.e. the area that you can see of the content, and the zoom level.
http://go4answers.webhost4life.com/Example/center-zoom-wpf-problem-159135.aspx
This might be useful for what you are doing:
http://autoscroller.codeplex.com/
summarizing I have implemented a chart control as a simple Canvas with a Polyline on it. The next thing I need is to be able to zoom the chart.
I would like to know how would you that (just the idea, no details needed). What I would like to do is to create somehow a bigger Canvas and paint the line bigger and just show a part of the Canvas to the user, and the he drags the Chart it will move the Canvas. Something like in the following picture. Do you think this is possible?
Kael Rowan from Microsoft Research built a ZoomableCanvas class that may do exactly what you want. You can also see all the posts he wrote about it. You can even try a running XBAP example if your browser supports it.
We use the RenderTransform for this, create your zoom and pan matrix( or transform ) and apply that to your canvas. The nice thing is, that you can still have elements that can display behind or on top of the canvas with the identity transform or with another. For example for a grid or screen space elements like a minimap, which should always be visible. You might also want to look into this old question, which is somehow related.