I have a Scroll view in My Viewcontroller. Also I had created a view and connected it to an IBOutlet variable. I need to add many views to the Scroll view.
Code for adding view to ScrollView :
In .h File
UIView *customView_;
@property (nonatomic, retain) IBOutlet UIView *customView;
In .m File :
@synthesize customView = customView_;
for (int i = 0; i < 2; i++) {
UIView *tempView = customView;
tempView.frame = CGRectMake(i * 187, 0, 187, 133);
[scrollView addSubview:tempView];
}
But using the above code, I am only able to see one in the position : 187,0,187,133. If I change the code to for (int i = 0; i < 3; i++) {
I am able to see the view only in 374,0,187,133. Can anyone please help me to Resolve this error?