I encountered a strange behaviour of a view in an iOS 6.1 app which I tried ran with the iOS 7 beta 2 and on my iPhone.
This app has a UINaviagationController which works fine if I run it in the iOS 6.1 simulator. However, with the Xcode DP the bottom part of the view is cut off. See picture.
Does anyone know how to fix this? I am drawing the box that you see as cut off on the bottom (self.frame.size.height) of the UIView which is managed by the navigation controller.
Thanks.
try subtracting the size of the box by the amount of the toolbar at the top. When using the self.frame.size.height, it will use the entire height as the location on the view, so when subtracting by the toolbar/navigation bar, it will raise that up just enough to fit the entire box onto the view
//clearly not objc but its just to show you how to implement it
boxLocation at (self.frame.size.height - (amount of toolbar/nav bar))
Hope this helps!
Related
I have a Xamarin iOS app that is created with a storyboard. The storyboard is set to view as iPhone 5. I have a webview as below that fits the screen fine. When run on an iPhone 6 plus, it seems to grow fine and fills the entire iphone 6 plus screen. However when used on an iphone 4, a web page will fall off the bottom of the screen... which indicates to me that the webview is too big.
I don't know why it seems to scale up but not down. I need the bottom of the webview to always pin to the bottom of the screen. How can I do this? I have tried the UI constraint icons but they never seem to work as expected. Can this just be done in code instead? Even in iOS objective-c would help as I can convert it to c#.
Any pointers would be great!!
It works on iPhone 5 and the 6 versions because iPhone6/6+ uses a compatibility mode. Resolution of iPhone 4 is smaller. Try single clicking the web view to switch to constraint mode (you'll see T and H shaped handles).
Drag the T shaped ones to the top, left, right and bottom border of the view controller's view. That will constrain height and with to the parent view's size.
For some strange reason, every new UIViewController I add into my project is not resizing according to the screen.
As you can see here in Xcode I'm using Retina 3.5 Inch Full Screen and it's supposed to look like this.
But in the iPhone the lower part of the screen is not being shown. This is what I see in a real iPhone 4.
As you can see, the button in the inferior part of the screen is behind that white bar and I can't click it.
I've really tried everything and I don't know what I'm missing.
I'm also tagging Objective-C as this could be cross platform.
I fixed the issue thanks to Luca. I was using a component for a Menu Bar that made the screen not to resize properly to 3.5 inch. Removed it and now everything works.
Ever since I have upgraded to iOS 7, all my content have shifted 20 points up, and I cant seem to get this fixed. I have looked elsewhere on ways to shift the content down, from adjusting the window, to the view, but none seem to affect the content views.
Can someone please tell me what to do to get the views shifted down.
Here are some screenshots:
Notice the window red background colour showing through at the bottom:
Notice how the pattern repeats at the bottom of the login page:
If your project doesn’t use Auto Layout, issues caused by the status bar differences between iOS 6 and iOS 7 can be resolved by using Springs, Struts, and iOS 6/7 Deltas.
Solution for you is to move the content down by 20px but the content wasn’t under the status bar in iOS 6.
To remedy this, use iOS 6/7 Deltas to set a negative Y Delta, equal to the number of points that we moved the content down for iOS 7. For example, if we moved content down 20 points for iOS 7, then we set a Y Delta of -20 points.
Follow this link
to get the correct direction as per your code.
Hope this will help you a lot.
Good Luck.
Could be the result of the translucency in iOS 7. Can you try the code below in your ViewController
-(void)viewDidLoad {
[self.navigationController.navigationBar setTranslucent:NO];
}
I Have Developed an Application. In that one i Added a GMSMapView and also Two Buttons at the Bottom. If i run this Application on iOS Simulator Version 7.0 all the outlets on the XiB are Visible. But If i run this Application on iOS Simulator Version 6.1 one of the Button is not Visible. Can any one please tell what is the Reason why it is hiding one button if the Height of the Device is Same.
You can use delta value that will effect the layout for the ios 6 not to the ios7
if you are set view as ios 7 in interface buinder you need to decrease you y position show image below
-64 delta y because you use navigationbar at top so it's size 44 and +20 for status bar
In The attached screen shots the code is the same.
The only differennce is - one was built with iOS SDK 5 (which shows OK) and the other with SDK 7 (which is presented on the screen with offset - BAD).
The screen output in IOS7 has unwanted vertical offset. The blue rectangle area in SDK5 is painted over in IOS7.
How can I have the same screen output the same in IOS7 as it was before?
You should try to fix this with with the Extend Edges settings.
Your content vc should have something like this settings (in the IB):
The same can be done in code:
self.edgesForExtendedLayout = UIRectBottom;
self.extendedLayoutIncludesOpaqueBars = YES;