I have been setting a SelectionIndicatorImage for my tab bar since iOS 5 calling this on launch:
[[UITabBar appearance] setSelectionIndicatorImage:image];
Now with iOS 7, when the app is first launched, the image is not showing anywhere (like if no tab was selected). After changing to another tab, it works properly.
Is this an iOS 7 bug or am I doing something wrong? Any idea for solving this?
Related
I have an app with the first screen being a login screen. Once the user has logged in, it segues to my tab bar controller with 5 tabs but at the moment it always opens the first tab by default.
How do I get it to open the 3-rd tab? I've done it before in AppDelegate but that was for an app with the starting screen being the tab bar view, but it doesn't seem to work when it's not.
Swift 3, iOS 10.3, Xcode 8.3 Beta 2
In your UITabBarController's viewWillAppear do
selectedIndex = 2
All App is working fine for ios 7 except the Navigation bar
is there any way to adjust it for ios 7 in xcode 4.6
i dont want to build this from xcode 5 because it creates too many other issues
Navigation bar issue is the content start from the y=0 which hides in the navigation bar.originally it should start next from the navigation bar
In iOS7 , frame starts below the status bar , so y=0 means it will be under the status bar.
To counter this, you should put y=20.
You can use "Show the size inspector" in interface builder (xCode 5 only, but doesn't require code at all). Where you can specify delta for any View that you have, so it will look like you want in both iOS6 and iOS7. Note that xCode builds interface for iOS7 without delta's, it applies delta to iOS6, iOS6 etc.
I was developing an App for iOS 6 and this is one of my views.
Now I've updated my iPhone to iOS 7 and this is the result:
Now all the views are behind the navigation bar because iOS 7' UIViewController's views starts at the top left edge of the screen and not under the UINavigationBar as iOS 6.
Now the "email" field is behind the navigation bar.
Is there a way to use the iOS 6 style?
Thanks
Marco
STEP BY STEP WITH IMAGES
Upon reading this question I was experimenting as I had the exact same question. I then found the answer.
1) Make sure storyboard is on iOS 7
2.) Select the viewcontroller from the storyboard (In your case the Login Controller)
3.) Make sure that 'Under Top Bars' is Deselected
You need to turn off translucent for the navigation bar and that should adjust the iOS 7 constraints to be the bottom of the navigation bar again.
They have completely removed the old style for navigation bars in iOS 7. You could set the navigation bar to be an image, which could utilize the look from iOS 6, but I think it would be safer to just go with the new iOS 7 default appearance.
I had a similar problem and I fixed it by writing following code in the views' viewWillAppear method:
self.edgesForExtendedLayout = UIRectEdgeNone;
Current version of Twiiter has a tab bar as shown below.
When I select a tab , it shows selected tab as pushed (deeper tab).
I want to implement same kind of tab bar in my iphone app for iOS 5.
How can I implement it ? Any knid of help is highly appreciated.
Thanks
You need create the image with the deeper look yourself and set the selectionIndicatorImage property on the UITabBar.
It's probably easiest to set this up using the appearance proxy in your AppDelegate:
[[UITabBar appearance] setSelectionIndicatorImage:yourImage];
I have implemented a customized navigation bar and toolbar in Xcode 4 targeting iOS 4.3 and now am updating my xcode 4.2 targeting iOS 5. In iOS 5 the customizations are not working, but whenever I use the iOS 4.3 simulator its working fine.
Thanks in advance
Are you customising the navigation bar using the drawRect category method?
If so I had the same problem, in IOS 5 the drawRect method is not called, IOS5 now has functions built in to customise the navigation bar.
IOS5 has a new appearance property which can be used to customise it, so what I did is check to see if the appearance property exists, if it does then you need to use the new appearance methods.
So I still have my drawRect category which is used when running on an IOS version < 5 and then in my view controller I do a check to see if the appearance object exists, if it does I then customise the navigation bar using that, now it works for both IOS 5 and below:
My viewDidLoad methods looks like below which sets the background of the navigation bar:
if ([self.navigationController.navigationBar respondsToSelector:#selector(appearance)]){
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:#"HeaderBar.png"] forBarMetrics:UIBarMetricsDefault];
}
You can also set the Appearance object for all navigation bars in your appDelegate by using the following code:
if ([UINavigationBar respondsToSelector:#selector(appearance)]){
[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:#"HeaderBar.png"] forBarMetrics:UIBarMetricsDefault];
}
The code above is setting up the appearance on the UINavigationBar class rather than a single instance of the navigation bar. This means that IOS will apply the appearance to all navigationBars.