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;
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.
Here is the problem. If you dynamically place controls in a panel, it works fine, but only until the vertical scrollbar appears. Once there is enough content for this to happen, it starts positioning controls nonsensically.
In my window, you can click a button to add another row of controls inside the panel, which represent options for an item in a list. If you scroll the vertical scrollbar on the panel all the way down and click the button again, the new row of controls will be positioned below the bottom edge of the panel out of view. If you scroll down, there is a huge gap between the new row and the previous row of controls. This should not happen. The positioning code is working flawlessly, as proven by debug output. As far as I can tell, the problem is the stupid anchoring system, however disabling anchoring on these controls does not fix the problem as one might expect. Instead, it just makes it position them wrong in a different manner. This makes no sense at all, and is super annoying!
I tried disabling Autoscroll in code before controls are added to the panel. No change. So I modified that code to disable both the vertical scroll bar and Autoscroll and set the scrollbar to not visible before controls are added. No change again, except that the now disabled vertical scrollbar still manages to appear usable when there is enough content in the panel in spite of it being disabled and set not visible!? That's not supposed to happen when I disabled and made it invisible! With anchoring disabled on the controls being added to the panel and once the vertical scrollbar has appeared, clicking the button to add a few more rows of controls now causes them to be indented a bit for no reason and positioned overlapping each other a bit vertically! It's as if the coordinate system in the panel has somehow arbitrarily changed, because of the presence of a vertical scrollbar and anchoring being disabled on the controls? The debug code shows that the controls are all being placed at correct coordinates, yet they appear positioned very wrongly. So my code is working perfectly, and therefore something else is the problem here.
Everything behaves exactly as expected up until the vertical scrollbar appears. This is so bizarre. Does anyone have any idea what on earth is going on with this stuff? Apparently it is far easier to make it do stupid stuff than to get it working properly.
Thanks again! I got it working. I went with TaW's solution first since it seemed like the simplest solution. Incidentally, I already tried TaW's approach days ago when I was fighting with it, but I had naturally subtracted the AutoScrollPosition value rather than add it, because I didn't expect it to be a negative value!
It seems very odd that control positioning is relative to the current AutoScrollPosition, as absolute coordinates seems like a much more natural, intuitive approach than having negative numbers. I guess that would make it slightly harder to place a control in the currently visible area, but I suppose that's not a big deal as most scrollable interfaces are probably initialized ahead of time and don't need to do that anyway.
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.
I used many expander in the WPF application.. but I face some troubles:
When I try to put them below each others, the upper one expands automatically and makes it difficult to put the net one below it.. So I should separate the upper one in any place until I put the lower one then move back the upper one again. Can I keep expander unexpanded to make it easy to put any controls below it?
When I press ctrl+f5 and expand one of them, I see it has a transparent background and makes interruption with the lower ones - how can I avoid that?
I used scroll bar inside expander, but it doesn't work when i press ctrl+f5. I have an inactive scroll bar. How can I make link between scroll bar and expander to be able to move items inside expander up and down?
This is a picture to explain what I mean.
have a look at ths tutorial, it covers stuff like this, The Expander can be a tricky control to deal with sometimes, but once you understand the the expanders layout it becomes a bit easier.
http://blogs.msdn.com/b/wpfsldesigner/archive/2010/02/03/taming-the-wpf-expander-control.aspx
I have many nodes and some of them are under the screen's edge. Tho treeview is scrollable, there is no vertical scrollbar on the right. How can i show it?
Did you happen to set the Scrollable property to false? If it is set to true, the control should display the scroll bars.
This "bug" can be replicated, but there is a workaround.
I have found that if you place a TreeView within a component, and mark the Scrollable property as "True", then in run time, the component simply "forgets" that the Scrollable property was marked as true.
The workaround is very simple. To make the TreeView "Scrollable", you must actually add a line of code to make it scrollable, because unfortunately the "bug" in this component is that it forgets.
For example, you must simply add in code something like this
tvTreeView.Scrollable = true;
This workaround fixes the problem, and the tree view will then properly display its Scroll bar(s).