Edit: This was a result of my own stupidity - the website I was liking to (iphone optimised) was not resizing to take advantage of the extra space, other pages display full screen.
Hi,
I've been trying to create a view that has no navigation bar, just a UIWebView that takes up the entire screen with a button to exit the view. I've managed to find a solution to hiding the navigation bar, but the problem is, it leaves a 44px space at the bottom of the view. So what I have is a webview taking up 460px on the screen, then just a white area below.
In Interface builder I tried to edit the size of the view but it was greyed out and set to 460px. Is there a way to make it so the webview takes up all 480px?
Thanks for any suggestions.
Chris
You can set the size of UIVewView programmatically in this way:
myWebView.frame = CGRectMake(0, 0, 320, 480);
and place it by example in viewDidLoad method.
Related
I recently updated my xcode to 4.5 but now my UIScrollView Doesn't work anymore, in my previous xcode I made the scrollview at the exact same way and placed a imageview background and some buttons in it, they scroll along when I scroll.
Now with this new xcode when I place something in it, it doesn't scroll at all. Only when I put textview in it and make the text longer then the screen then it will scroll, but even then when I place a button on it the button won't scroll along, just the text. It's realy annoying and I don't know what Im doing wrong.. I've been trying to find a solution to this all day.
my ScrollView is placed in my view and got size 320,480.
in my ViewDidLoad I have:
[scroller setScrollEnabled:YES];
[scroller setContentSize:CGSizeMake(320, 481)];
I also have a picture to make my setup more clear, When I run the project in this picture it does scroll because of the text length. the image background is 320x960 but the picture doesn't scroll along it should go to the bottom where to color becomes more dark.. I hope you understand what I mean.
Extra
I made a video showing what I do, showing that it doesnt scroll when I put something in it
http://www.youtube.com/watch?v=rzYTWLiIC8g&feature=youtu.be
set your scrollView contentSizes height more than its original height then it would be vertically scrollable for sure.
Try this -
[scroller setContentSize:CGSizeMake(320, 800)];
Then see it scrolls or not.
I currently have an iPhone application which utilizes the tab bar control. I was wondering if it is possible to move the tab bar up from the bottom of the screen and place an imageView underneath it. Thanks in advance!
You should be able to set the UITabBar's frame like so:
myTabBar.frame = CGRectMake(0, 240, 320, 50);
Even though you might can, it is not highly recommended to do it, because it doesn't stick to the Human Interface Guidelines, which state that a tabbar should always appear on the bottom of the screen.
You can use
myTabBar.frame = CGRectMake(0, UIApplication.sharedApplication().statusBarFrame.size.height, UIScreen.mainScreen().bounds.size.width, 50);
Note: it takes effect only in viewDidLoad() and not in any other method. So if you use hideBottomBarWhenPushed() method to hide the tabbar it hides tabor when pushed but when the view is poped, tabbar sticks to the bottom even if you set its frame to top. Moreover personal hotspot bar overlaps your tab bar frame. Try alternative
I'm trying to display an UIImageView within a tab on an iPad. I hide the tab bar and I want the UIImageView to take up the entire screen, ie be full screen. I try resizing everything in sight and the image will not occupy the space used by the tab bar.
I've tried debugging, printing the frame for each view going up the view hierarchy. Everything looks ok until it gets up to UIViewControllerWrapperView which has the smaller size.
What is UIViewControllerWrapperView and how do I resize it?
have you tried reseting the frame on the UIImageView
[imageView setFrame:theController.view.bounds];
Building an iPad app. I have a button on my main view that I want to launch a help window. The help window is fairly involved and has its own xib/controller. I resized the help window's XIB and saved it. I instantiated it and added it to the application controller's views as a modal. For some reason this window is still taking up the entire screen.
What I really want to do is have a "view" that's maybe 70% of the width and height that lays over the normal view as a modal. How is this accomplished normally? I want it to require that they hit a button to close it.
Thanks
You could also try placing your UIView into another UIView that actually takes up the entire screen, but has a backgroundColor = [UIColor clearColor].
Modal view controllers are really intended to take up the entire screen, as Apple's description states "Modal view controllers are a tool that you have at your disposal for displaying a new screen’s worth of content" (http://developer.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/ModalViewControllers/ModalViewControllers.html).
I am trying to create a mid-size screen for my app on iPad.
In didFinishLaunchingWithOptions(), I do this:
CGRect winRect = CGRectMake(100,100,500,500);
navController.view.frame = winRect;
the screen comes up fine and I can click around and do stuff until the orientation changes. It takes the screen to original full size - how can I make it stick to my winRect frame? I tried setting the parentViewController.view.frame/view.frame to winRect in willRotateToInterfaceOrientation() but no good.
Any ideas?
Thanks.
Generally, you shouldn't mess with the frame of a view controller's view. View controllers tend to resize their views on many occasions, for example when toolbars and navigation bars are hidden or made visible or when the interface orientation changes.
For custom-sized views, create a separate view, set its frame to your custom size and add it as a subview to your view controller's view.