navigationbar

How to add a right bar button to a navigation bar in iphone

别等时光非礼了梦想. 提交于 2019-12-09 14:21:51
问题 I want to add a right bar button item to the navigation bar, so that on click, it performs certain a function. I have created the following code to add the right bar button item, but after it is done, the bar button item is not getting displayed in navigation bar: -(void)viewDidload{ self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(Add:)] autorelease]; } -(IBAction)Add:(id)sender {

Prevent BottomSheetDialogFragment covering navigation bar

醉酒当歌 提交于 2019-12-09 04:13:09
问题 I'm using really naive code to show a bottom sheet dialog fragment: class LogoutBottomSheetFragment : BottomSheetDialogFragment() { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { val view = inflater.inflate(R.layout.view_image_source_chooser, container, false) return view } } This is how I called this dialog: LogoutBottomSheetFragment().show(supportFragmentManager, "logout") But I get this horrible shown in the image below. How

How to customize the color of the navigation bar in qlpreviewcontroller

天大地大妈咪最大 提交于 2019-12-08 16:23:21
问题 Can I customize the color of the navigation bar in the QlPreviewController controller? I have tried following [[UINavigationBar appearanceWhenContainedIn: [QLPreviewController class], nil] setBarTintColor: [UIColor redColor]]; but it does not work. Thanks. 回答1: Yeah, there is a bug with barTintColor on QLPreviewController for iOS 11 if you are showing it via presentViewController: animated: Here's my solution, use setBackgroundImage: with 1x1 image instead of setBarTintColor: [

reduce left space and right space from navigation bar left and right bar button item

谁都会走 提交于 2019-12-08 04:30:14
问题 I am adding two custom buttons on navigation bar. one at left and other at right. I am successfully done with it, but I failed to reduce the space between the starting point and frame of buttons. I tried a lot, also gave the negative value of x, still didn't helped. Here is the code for buttons -(void)addLeftButton { UIButton *aButton = [UIButton buttonWithType:UIButtonTypeCustom]; aButton.backgroundColor = [UIColor redColor]; [aButton setTitle:@"H" forState:UIControlStateNormal]; aButton

Objective-c: start app with second view with a navigation bar

[亡魂溺海] 提交于 2019-12-08 03:18:49
问题 I'm creating an App for Ipad, I created 3 views with a navigation bar but I would to start my application not in first but in second view, what can i do? 回答1: You can setup UINavigationController with an initial navigation stack via setViewControllers:animated: . // in application:didFinishLaunchingWithOptions: self.navigationController = [[UINavigationController new] autorelease]; UIViewController *first = [[MyFirstViewController new] autorelease]; UIViewController *second = [

Shows a faded gray color view through iOS 7 Navigation bar of a UISplitViewController

狂风中的少年 提交于 2019-12-07 16:10:37
问题 I have written a test iPad app which contains only a split view. I used the storyboard for set the split view. I did not do any modification to the generated split view controller by the storyboard. But did some modifications to the master view controller and the detail view controller as follow, Master View Controller: - (void)viewDidLoad { [super viewDidLoad]; ............ if ([self respondsToSelector:@selector(edgesForExtendedLayout)]) { self.edgesForExtendedLayout = UIRectEdgeNone; } }

Set navigationBar color on Android Lollipop with Full screen activity

时光总嘲笑我的痴心妄想 提交于 2019-12-07 15:28:09
问题 Is there a way to set the navigationbar color in a fullscreen activity? if(android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { getWindow().setNavigationBarColor(getResources().getColor(R.color.Theme_color)); And this line in my theme-style: <item name="android:navigationBarColor" tools:targetApi="21">#E64A19</item> Both resulting in the same transparant navbar above my activities layout... Code: Acitivity : @Override protected void onCreate(Bundle savedInstanceState) { super

How to hide navigation bar in Android app?

╄→尐↘猪︶ㄣ 提交于 2019-12-07 11:39:18
问题 I was wondering how I could hide the navigation bar in an Android application? I know how to hide it initially, but as soon as I touch the screen it pops back up. I want to hide it the same way games like Clash of Clans hide it where the only way to make it pop up is by swiping down the notifications or by swiping where the navigation bar should be. 回答1: use immersive mode check this Immersive mode // This snippet hides the system bars. private void hideSystemUI() { // Set the IMMERSIVE flag.

How do I change the color of soft keys to white in android(Navigation buttons)

假如想象 提交于 2019-12-07 10:47:25
问题 I am making a basic launcher app where i needed my notification bar and status bar to be perfectly transparent. So i used below code. Window w = getWindow(); // in Activity's onCreate() for instance w.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); Which does the trick but the color of the softkeys is not white as shown in figure below. How do i make it white? 回答1: Ok finally solved it in lollipop. But i haven't tested in devices

LargeTitles UIScrollView does not support multiple observers implementing _scrollViewWillEndDraggingWithVelocity:targetContentOffset

那年仲夏 提交于 2019-12-07 02:51:04
问题 I have implemented large titles in my app with the following code: if #available(iOS 11.0, *) { navigationController?.navigationBar.prefersLargeTitles = true navigationItem.largeTitleDisplayMode = .always } else { // Fallback on earlier versions } } func scrollViewDidScroll(_ scrollView: UIScrollView) { if scrollView.contentOffset.y <= 0 { if #available(iOS 11.0, *) { self.navigationItem.largeTitleDisplayMode = .always } else { // Fallback on earlier versions } } else { if #available(iOS 11.0