开发者

iphone - how to refresh a uiview with a scrollview?

any advice welcome! :)

My screen design is landscape with text on the left (this is in the main view) and a scrollview on the right (which contains an interactive map image)

The mainviewcontroller contains the scrollview as an outlet. In the scrollviewcontroller I add a 'map' view into the scrollview. In the mapviewcontroller I update an array in the appdelegate, depending on the user input.

I would now like to refresh the main uiview that c开发者_StackOverflow社区ontains the scrollview to display the updated text from the appdel array - whenever the user clicks a button.


You should call your view's -(void)setNeedsDisplay method to cause it to redraw.

[myView setNeedsDisplay];

See Apple's reference documentation here: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIView_Class/UIView/UIView.html%23//apple_ref/doc/uid/TP40006816-CH3-BBCCADHC


You have to call viewWillAppear from the other viewcontroller

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜