I have a UIScrollView
which contains full width images. I want a UIView
on top of the UIScrollView
at every point of time. Initially the output is correct, I am getting the UIView
over the UIScrollView
. But when I scroll right, the UIView
is moving along with the first image to the left. How can I keep the UIView
always on top ? Do I need to implement any other methodology ?
-(void)setSalonImagesScrollView{
int x = 0;
for (int i = 0; i < [self.imageList count]; i++) {
CGFloat xOrigin = i * self.view.frame.size.width;
UIImageView *salImg =[[UIImageView alloc] initWithFrame:CGRectMake(xOrigin,0,320,194)];
NSData *imageData = [NSData dataWithContentsOfURL:[NSURL URLWithString:self.imageList[i]]];
salImg.image = [UIImage imageWithData:imageData];
salImg.tag = i;
[self.salonImgCarousel addSubview:salImg];
[self.salonImgCarousel insertSubview:self.navSubView belowSubview:self.navSubView];
x += salImg.frame.size.width;
}
self.salonImgCarousel.contentSize = CGSizeMake(x, self.salonImgCarousel.frame.size.height);
[_salonImgCarousel setShowsHorizontalScrollIndicator:NO];
[_salonImgCarousel setDelegate:self];}