How to show a UISegementedControl over a UIImageView/UIScrollView?
I tried minimizing the area of uiscrollview/uiimageview but to no avail. Here is my code to add the views:
[self.scrollimg addSubview: self.theimg];
[self.view addSubview: self.scrollimg];
[self.view addSubview: self.segmntdctrl];
This shows the scrollable image but without the segmented control. They are all created through interface builder.
Thanks
Edit: More code-
self.theimg.frame = CGRectMake(0, 0, image.size.width, image.size.height);
self.theimg.contentMode = (UIViewContentModeScaleToFill);
[self.theimg setImage:image];
self.scrollimg.clipsToBounds = YES;
self.scrollimg.de开发者_运维技巧legate = self;
[self.scrollimg setContentSize:self.theimg.frame.size];
Set the frame
for the segmntdctrl
. Don't know how it is configured in the IB but it might have a frame that is putting it out of the visible region of its parent.
did you try
[self.view bringSubviewToFront:self.segmntdctrl]
?
精彩评论