How to Hide Navigation bar back button title globa

2019-07-17 06:22发布

I used this code in AppDelegate,

UIBarButtonItem.Appearance.SetBackButtonTitlePositionAdjustment (new UIOffset (-100, -60), UIBarMetrics.Default);

But it position is changed to bottom. I have attached the result screenshot.

screenshot

1条回答
走好不送
2楼-- · 2019-07-17 07:04

Solution1 : set Title Color instead of Title Position

UITextAttributes attribute = new UITextAttributes {TextColor = UIColor.Clear };
UIBarButtonItem.Appearance.SetTitleTextAttributes(attribute, UIControlState.Normal);

Solution2 : set horizontal offset only.

UIBarButtonItem.Appearance.SetBackButtonTitlePositionAdjustment (new UIOffset (-100, 0), UIBarMetrics.Default);
查看更多
登录 后发表回答