i create a new InputData.xib which has few text box which actually larger than iphone screen, but when i exe the app, text box which in beyond the iphone screen is hidden and i unable to scroll the screen, how this can resolve,
thanks
In general, the iPhone screen has a window that is of fixed size and position. All scrolling needs to be done with UIScrollView objects. UITextView is a subclass that works well for text. UITableView is for lists, like in the iPod app. UIScrollView itself can be used for anything else.
You should probably use a UITextView, rather than a UITextField. Make its bounds equal to the screen bounds; if there's more content than will fit, it will handle scrolling within it automatically.
Related
I have one storyboard file for iPhone devices, and in one of the views there is a subview that contains a UIPickerView, and, when it runs on the iPhone 4 the UIPickerView is stuck at the bottom of the view as it should be, but when it comes to the iPhone 5, the UIPickerView appears a little above of the bottom of the screen.
If I fix the problem for the iPhone 5, the UIVPickerView won't appear completely when I run it on the iPhone 4. (half of it appears below the screen)
So is there a way to have the UIViewPicker well laid for both iphone 4 and 5 resolutions?
NOTE: I solved the issue by creating a completely new subview with the UIPickerView. Now it is well laid whatever the device is.
When creating the picker, you need to use the size of the screen to determine the location. It seems like you are just putting in the coordinates for the y manually, which only works when using one screen size.
If your view that you are in is the same size as the screen, as it most likely is but may not be, you can do:
int y = self.view.frame.size.height;
and use that as the y-coordinate of your pickerView.
Otherwise, you can find the size of the screen by using:
[[UIScreen mainScreen] applicationFrame].size.width //if in portrait
//or
[[UIScreen mainScreen] applicationFrame].size.height //if in landscape
Then you have to subtract the height of the navigationController from that if you have one.
If you're using autolayout, you should be able to change the constraints the picker uses to get it to stick to the bottom. Select the picker, click the "H"-shaped autolayout menu icon in the bottom right corner of the storyboard, and choose "Bottom Space to Superview". Then delete any constraints attaching the picker to the top of the screen. If that doesn't work, make sure that all of the picker's superviews have constraints to attach them to the bottom, too; you'll have to decide whether you want them to resize or slide down on an iPhone 5.
I fixed the issue. Not sure what was going wrong but I deleted the subview, then created a new one and added the UIPickerView. Surprisingly, now it is well laid whatever the device is.
You may find my question stupid but I'm new to Objective C dev and I'm still learning basic things. I made a form in my app with a text field in the bottom of the view. But when this field get the focus, keyboard shows up and it hides the field so no way to see what I'm typing. I've found solutions online about it especially with the use of UIScrollView to fix the issue.
The issue I've now is with the Scroll View itself. I moved my text field to replace it with a UIScrollView of about same size, then I drag drop my field back but this time as a subview of the ScrollView. But when running the app the text field is going up, that is its position in interface builder is different to what I can see when running the app.
I need your help about the size I need to apply to the Scroll View and its content to make it useful in this case. Should it have the exact size as the text field ? should it have the same size as the whole view ?
Thx for helping,
Stephane
A UIScrollView has two "sizes". The one is that of its own frame (i.e. how much space does it take up). And how large is the contentSize of the scrollview (i.e. how far left/right/up/down can we scroll)
The general Idea would be this:
your UIScrollView has the size of the available screen real estate when the keyboard is hidden (say 320 x 460 or so), it takes up as much space as its content (assuming your content also needs 320 x 460), scrolling isn't enabled.
once the keyboard shows, the scrollView will have to scale down (say 320 x 244), the content obviously doesn't scale down, that way you're now able to scroll.
I'd probably use something like
moveTextViewForKeyboard:(NSNotification*)aNotification up: (BOOL) up
to trigger the frameSize change of the scrollView and enable scrolling.
I'm quite new to iPhone development, and now dealing with a remote control app. Currently I can receive desktop image and perform simple mouse operations. But I still want to show a mouse pointer on my iPhone screen.
The desktop (very big, 1280X800) is in a image view which is the subview of a scroll view. Is there any way I can add a pointer image on top of the desktop image, and set it to any place I want? The pointer image do not receive any user interaction, it would be just floating on the desktop image.
Thank you very much for help.
Yes, just create a new UIImageView (or any other UIView subclass) with a frame based on where you want it to appear and add it to the scroll view's view using the addSubview: method. By default subviews you add later will appear above subviews you add earlier, but you can explicitly control which view appears on 'top' using 'bringSubviewToFront:'.
I have a UIWebView displaying content of multiple pages in length.
The problem is this: a scroll bar never appears while the user is scrolling the content vertically (unlike in Safari, or in other apps using what appears to be UIWebView). I can't see any way to control this programmatically.
Behaviour is the same on iOS 3.1 through 4.2, on both iPhone and iPad, both device and simulator.
Anyone have any ideas?
Are you sure the WebView is not slightly bigger than its parent? If it's a bit too big the scroll bars might actually be there but off the screen.
[(UIScrollView*)[webview.subviews objectAtIndex:0] setShowsVerticalScrollIndicator:YES];
Can Anyone tell me how to slide textview in iphone in the same manner as we do with images.
I am developing an application in which I want to side the TextView. I have 5 TextViews.
Can anyone help me with this.....
Thanx in advance...
You'll want a UIScrollView with paging enabled. Since with paging the view "stops on multiples of the view bounds" (according to the docs), you'd just line up your five text fields side-by-side, and make them the width of the visible area (the screen) inside a container view that sized to contain all 5.