titleview

adding icon between back button & title of navigation bar

最后都变了- 提交于 2019-12-23 03:14:20
问题 I want to put an icon by side of the title of my navigation bar. I'd prefer not to implement it as a custom titleView, because then i'll need to create a custom titleView for each controller i put on the stack (and I have pretty deep nesting). I'm adding currently as an UIImageView to a navigationBar. My problem is to calculate exactly this icon's horizontal position. It depends on the width of the back button, which has each time another title. How do I calculate this back button frame?

iOS 11 Navigation TitleView misplaced

左心房为你撑大大i 提交于 2019-12-19 02:30:42
问题 I have an iOS app in which I am setting a custom navigation title view. It was working fine till iOS 10, but in iOS 11 the navigation title view is misplaced. Here is the screen shot for iOS 10 - Here is the screen shot for iOS 11 - As you can see in the screen shots that when I run the code on iOS 10 the title view appears to be fine. But the same code on iOS 11 shifts the title view down by some pixels and it gets cut. This is how I am setting the title view - navigationItem.titleView = MY

TitleView not covering the entire toolbar

£可爱£侵袭症+ 提交于 2019-12-13 03:42:24
问题 I am developing notification count on Toolbar using TitleView . Inside TitleView I have used RelativeLayout which is cropping from top side not showing full count circle Label . This is my code: <NavigationPage.TitleView> <RelativeLayout HorizontalOptions="Fill" BackgroundColor="Transparent"> <Image Source="bell.png" HeightRequest="30" WidthRequest="30" x:Name="yellowBoxView" RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.018,Constant=0}"

Can you use UIAppearance to set the titleview of UINavigationItem?

时光怂恿深爱的人放手 提交于 2019-12-10 12:39:39
问题 I currently use this code to set the titleView of my navigation item: - (void)viewDidLoad { ... UIImage *navbarTitle = [UIImage imageNamed:@"navbartitleview1"]; UIImageView *imageView = [[UIImageView alloc]initWithImage:navbarTitle]; self.navigationItem.titleView =imageView; } Is there a way I could put this code using UIAppearance? [UINavigationItem appearance] is not valid. 回答1: No you wan't be able to do that with UIAppearence , what you can is to have a UIViewController from where all the

UIButton style when added to navigationItem.titleView

為{幸葍}努か 提交于 2019-12-04 14:38:02
I need to add a button to the UINavigationItem titleView (actually to the center of the UINavigation Bar. I've used the following code to accomplish so: UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect]; btn.frame = CGRectMake(0, 0, 70, 30); [btn setSelected:YES]; [btn setTitle:@"list" forState:UIControlStateNormal]; And I've go the following: I need to give the same style of the "Done" button (which is UIBarButtonItem ) to the button "list"? You can use UISegmentedControl: UISegmentedControl *mySegmentedControl = [[UISegmentedControl alloc] initWithItems:@"Example"]];

iOS 11 - UINavigationItem titleView when using Large Titles mode

☆樱花仙子☆ 提交于 2019-12-03 13:21:09
问题 I'm trying to understand either it's a bug or it's the expected behavior. On iOS 10 and earlier we could set up a custom title, using navigationItem.titleView . On iOS 11 , when setting our navigationItem.largeTitleDisplayMode = .always and setting navigationItem.titleView = <Some cool UIButton> it's displaying both the normal navigation title bar and the large navigation title. Illustration: To sum up: How can we use custom titleView on our Large Navigation Title? EDIT : This is the expected

iOS 11 - UINavigationItem titleView when using Large Titles mode

霸气de小男生 提交于 2019-12-03 03:24:33
I'm trying to understand either it's a bug or it's the expected behavior. On iOS 10 and earlier we could set up a custom title, using navigationItem.titleView . On iOS 11 , when setting our navigationItem.largeTitleDisplayMode = .always and setting navigationItem.titleView = <Some cool UIButton> it's displaying both the normal navigation title bar and the large navigation title. Illustration: To sum up: How can we use custom titleView on our Large Navigation Title? EDIT : This is the expected result: I was able to replace the navigation bar big title with a custom view by using a subclass of

My UINavigationitem's TitleView getting expanded in ios 6

こ雲淡風輕ζ 提交于 2019-12-01 19:06:23
问题 In my app i have applied an image on uinavigation item.It is running fine in iOS 5 but getting expanded on iOS 6.I have no left or right bar button item in navigation bar. I searched too much but couldn't find answer. Help me if you know the answer. Here is my code- UIImageView *navigationImage=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 98, 34)]; navigationImage.image=[UIImage imageNamed:@"topNav-logo.png"]; self.navigationItem.titleView=navigationImage; and image shows like this- !

My UINavigationitem's TitleView getting expanded in ios 6

こ雲淡風輕ζ 提交于 2019-12-01 18:51:36
In my app i have applied an image on uinavigation item.It is running fine in iOS 5 but getting expanded on iOS 6.I have no left or right bar button item in navigation bar. I searched too much but couldn't find answer. Help me if you know the answer. Here is my code- UIImageView *navigationImage=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 98, 34)]; navigationImage.image=[UIImage imageNamed:@"topNav-logo.png"]; self.navigationItem.titleView=navigationImage; and image shows like this- ![enter image description here][1] It should be displayed like lower image but it is displayed like

iOS 11 Navigation TitleView misplaced

限于喜欢 提交于 2019-11-30 20:10:03
I have an iOS app in which I am setting a custom navigation title view. It was working fine till iOS 10, but in iOS 11 the navigation title view is misplaced. Here is the screen shot for iOS 10 - Here is the screen shot for iOS 11 - As you can see in the screen shots that when I run the code on iOS 10 the title view appears to be fine. But the same code on iOS 11 shifts the title view down by some pixels and it gets cut. This is how I am setting the title view - navigationItem.titleView = MY_CUSTOM_TITLE_VIEW I tried many things and searched for many solutions but nothing is working. Here's