0

AM facing trouble in showing Images on the ImageView, added on UIScrollview, after rotation

I am having few UIImageViews(8 diferent) on my UIScrollView.

The Problem, is when I rotate my Device, I have changed the frame(x,y axis only) of UIscrollview and of (x,y axis only) , It doesn't displays the Images, I added on the UIimageViews after Rotation.

After Rotation, I touched the ScrollView, and then It shows the Images on the Uiimageviews again. I tried everything. Surfed Stackoverflow and google, found nothing, working in my case.

//Magazine Images
        //subview1 MAG Imaegs
        [[asy_Array_Mag_sub1 objectAtIndex:0] setFrame:CGRectMake(59, 120, 136, 174)];
        [[asy_Array_Mag_sub1 objectAtIndex:1] setFrame:CGRectMake(296, 120, 136, 174)];
        [[asy_Array_Mag_sub1 objectAtIndex:2] setFrame:CGRectMake(576, 120, 136, 174)];
        [[asy_Array_Mag_sub1 objectAtIndex:3] setFrame:CGRectMake(802, 176, 136, 174)];
        [[asy_Array_Mag_sub1 objectAtIndex:4] setFrame:CGRectMake(57, 465, 136, 174)];
        [[asy_Array_Mag_sub1 objectAtIndex:5] setFrame:CGRectMake(296, 383, 136, 174)];
        [[asy_Array_Mag_sub1 objectAtIndex:6] setFrame:CGRectMake(570, 377, 136, 174)];
        [[asy_Array_Mag_sub1 objectAtIndex:7] setFrame:CGRectMake(802, 486, 136, 174)];


        [self.otlScrollView setFrame:CGRectMake(0, 0,  1024, 768)];

        self.otlScrollView.contentSize = CGSizeMake(1024 * total_pages, 768);



        [_otlSubView setFrame:CGRectMake(a1, 0, 1024, 768)];
        [self.otlScrollView addSubview:_otlSubView];
        [_otlSubView2 setFrame:CGRectMake(b1, 0, 1024, 768)];
        [self.otlScrollView addSubview:_otlSubView2];
        [_otlSubView3 setFrame:CGRectMake(c1, 0, 1024, 768)];
        [self.otlScrollView addSubview:_otlSubView3];





        [_otlScrollView setContentOffset:CGPointMake(1024 * (self.otlPageControl.currentPage), 0)];
Qantas 94 Heavy
  • 15,750
  • 31
  • 68
  • 83
Jasmeet
  • 1,522
  • 2
  • 22
  • 41
  • Dont post duplicate of your question, add a bounty for your question or edit your question: [Content of UIscrollview not updating, when changing orientation](http://stackoverflow.com/questions/21859624/content-of-uiscrollview-not-updating-when-changing-orientation) – rckoenes Feb 19 '14 at 09:46
  • @rckoenes OK, will keep thing in mind. Do you know, why am facing this problem? Is there any thing I missed? – Jasmeet Feb 19 '14 at 09:54
  • @Jeev can u add some code – Nassif Feb 19 '14 at 10:22
  • @Nassif I have edited the question, by adding code. Please have a look – Jasmeet Feb 19 '14 at 10:27
  • @Jeev the frames are not proper also are u adding these images to the scrollview,if u are looking for a grid type ,i would suggest you better go for uicollectionview. – Nassif Feb 19 '14 at 10:31
  • @Nassif But My compenets are placed at different places. Collection view doesn't provide that much flexibilty and I have IMplemented 100% of the UI, at this point – Jasmeet Feb 19 '14 at 10:33
  • @Jeev [asy_Array_Mag_sub1 objectAtIndex:0] is it uiimageview – Nassif Feb 19 '14 at 10:38
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/47851/discussion-between-jeev-and-nassif) – Jasmeet Feb 19 '14 at 11:31

0 Answers0