I have a ScrollViewer containing a gallery of images and need to add the function of "pop up" with the description of each image, ie when the function will receive the ScrollViewer singletap displays information about this specific picture, anyone have any idea how to do this. Thank you.
I would put a UILabel (properbly with black, semi transparent background and white Text) above the UIScrollView. When it is taped (see how you detect taps here) you could fill the UILabel with the current image's description and make it visible or fade it in. Once the scrollview stars scrolling again (use scrollViewWillBeginDragging: from the UIScrollViews delegate) you can hide the Label again.
Related
I have a background image and I need to add bunch of oval buttons or images on in my case the "greenish" buttons on top of the background image, that I can click in each one of them and call a function passing a parameter. Please look on the screen shot and let me know how I can position every one of the buttons on top of the image and access them with a click (onPress). I guess the only way is using flex box but I couldn't figure out the style for it.
Thanks
Just style all the green buttons on relatively to the image's boundaries with position: absolute. Percentage values for positioning should work, if your image scales properly on screen size change.
Posted is a picture of my issue.
I'm fairly new to Xcode and I have a UIImageView object in my View. I added another View (white rectangular box) within the View, and below the UIImageView object.
If I try to resize the inner View in any way using the cursor, the Image View resizes to 0 as shown below. However if I use the Size Inspector (ruler icon) on the right to resize the subview, the Image View stays the same size. What the heck?
Is there some setting I need to adjust? Thanks
I have one view filling the screen with a background image. Other views (text fields) are in exact positions (the background image includes the text field background images). When I change from 3.5" screen to 4", the text fields don't change in the same way that the background resizes. The bg image simply resizes to fill the screen, but the text fields jump out of alignment.
Is there a way to have two sets of constraints, one for each screen size? or is there a way to have views resize proportionally to another view?
EDIT:
Is there a way to have two sets of constraints, one for each screen
size?
Yes, by adding constraints programatically and checking [[UIScreen mainScreen] bounds] to get the screen size.
or is there a way to have views resize proportionally to another view?
Yes, you could set this up in interface builder. But it will be hard to manage, I would manage the constraints manually in code since you are using a custom background image the textviews need to position exactly
You're going to struggle to get these things to line up properly with the text view backgrounds being part of the background image.
You should amend your image assets and use the background property of UITextField to have an actual background image, and remove the boxes from your main background image. The icons could be separate images as well.
Failing that, it would make more sense to have the image stretch underneath the text boxes rather than on top.
Your layout is doing what it should do based on your description, but the image isn't stretching in the right way. In your screenshots, username is always the same distance from the top, and the others are the same distance from the bottom, but that isn't how image stretching works. I don't know how you've set it up but it would make sense to have a single image the size of the 4 inch screen, which has the bottom cut off for 3.5 inch devices, and constrain everything from the top.
I have an UIScrollView which contains one UIImageView. Everything is working correctly, I can zoom in and out, when zoomed in I can pan around, etc.
The problem that I am unable to solve is how to pan a zoomed out image around the screen. The user needs to be able to zoom the image out until it's small, and then move that small image to any point on the screen. Sadly, it's stuck in the center of the screen (usually, it would be stuck in the top left corner but I did fix that problem).
There are a couple of things you need to do here. I suggest doing them in viewWillAppear rather than viewDidLoad because if you're using storyboards, it doesn't work quite right in viewDidLoad.
First, you need to set the content size property of your scroll view to be the size of the photo itself because you want the entire area of your photo to be scrollable.
self.scrollView.contentSize=self.photoShown.size;
photoShown is UIImage. scrollView is a UIScrollView
Second, you need to set the frame of your UIImageView that houses your image to be the size of your image:
self.imageView.frame=CGRectMake(0,0, self.photoShown.size.width, self.photoShown.size.height);
if you haven't done this, then the frame of the UIImageView is the size of the screen itself and there is simply nowhere to pan. That's why it needs to be bigger, so you can pan to the regions not currently shown on screen.
I have an NSScrollview that takes up an entire window. The scrollview has a vertical scrollbar but no horizontal scrollbar. The window color is gray. The window is resizable.
Cocoa automatically draws a white square with a light gray border around the window's resize handle (right below the bottom of the vertical scroller). I would like to remove that little white square so that the gray window color and resize grooves show through. How do I do that?
Share photos on twitter with Twitpic http://twitpic.com/show/thumb/27dcp1.png
Just a guess, but try setting the scroll view's background color to [NSColor clearColor].
Send the window a setShowsResizeIndicator:NO and draw your own indicator as you like...