开发者

How to change X and Y of a button

I'm using MonoTouch. When I rotate to LandscapeRight/Left I want to change the location of some of my buttons but I'm not having any success. I'm replacing the button.Bounds with a new rectangleF and setting that value in the WillRotate, but that's not working.

I am returning true in my 开发者_如何学PythonShouldAutorotateToInterfaceOrientation handler.

In principal what I'm trying to do is allow as much as possible to automatically rotate but then fix a couple of buttons that end up in a bad place.


WillRotate is called before rotation, you're going to want to modify the bounds in DidRotate instead.


Are you sure you want to change Bounds and not Frame? Bounds will change the buttons' dimensions, where with the Frame property you can adjust X and Y. Other than that: Geoff said it already: you'll need DidRotate

René

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜