Post

Replies

Boosts

Views

Activity

Navigation bar color is wrong
Hi,I'm having a really weird problem. Brand new project, using a UINavigationController. I want to set the background color of my navigation bar to match the background color of my root view controller.I thought that this was the right way to do it: [[UINavigationBar appearance] setTranslucent:NO]; [[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:0x2d/255.0 green:0x55/255.0 blue:0x97/255.0 alpha:1.0]];However, this generates a navigation bar with a color value of #234185 instead of the expected #2D5597. What is the explanation for this, and how do I fix it?Thanks,Frank
Topic: UI Frameworks SubTopic: UIKit Tags:
3
0
4.1k
Jan ’21
Portrait only on iPhone but any orientation on iPad?
I'd like my app to run in Portrait mode only on iPhones, but any orientation on iPad. Years ago, I recall being able to do this by overriding or implementing some callback functions for orientation, which seemed to change with every other iOS release. I'm hoping there is a simpler way to do this today. I was hoping that the Deployment Info tab in Xcode would let me set different Device Orientation choices for iPhone and iPad, but this doesn't seem to be the case. I'm sure I could hack around and come up with some solution, but I'd like to learn what the "right" way is to do this in current versions of iOS. Thanks, Frank
0
0
392
Dec ’20