Tuesday 15 February 2011

ios - Creating UIScrollView Programmatically -


I am trying to create a UIScrollView programatically I set up a property and synthesize it.
  @property (weak, nonatomic) IBOutlet UIScrollView * topScrollView; @ Synthesize topScrollView;   

Then I have a method that does this

  [top scroll view setframe: CGRactack (320, 0, 320, 65)]; [Topscreenview content contents: CGSizeMake (500, 100)]; [TopSolveviewBack color: [UIColor greenColor]]; [TopcrollviewScroll is enabled: Yes]; [TopScallviewSetoshowhorigintool scroll indicator: Yes]; [TopScallViewSetSearchVerticalSurcal Indicator: No]; [[See self] Adsview: TopSolveive];   

I put it in the viewfinder. This does not make scroll view I think this is because the scroll view has not been started. I can allocate and initialize in the above method, but then when I want to use it in any other method, it does not work. I did not see much help but probably a simple solution that I do not know about programmable to create this scroll view and what I can do to use it in any other method ( To operate).

thanks,

Evan

me It seems that this is because the scroll view has not been started.

Correct.

I can allocate and initialize in the above method but then when I want to use it in any other method, it does not work.

If you specify a new or small allocated scroll view, an asset or example variable, it will be. That's what they are.

Oh, one more thing you will need to make sure that your scroll view is kept in any way. This means that by changing your topScrollView property to strong , or adding it to a view (which will then retain it) or both.

No comments:

Post a Comment