CSS修复容器和溢出元素(CSS Fix container and overflow elements)
Iam wondering if it is a way to force overflow elements of an fixed container to be on the same line instead of going on a new line.
Thank you.
原文:https://stackoverflow.com/questions/6117926
最满意答案
您需要创建自己的条形按钮项并将其分配给先前的视图控制器navigationItem backBarButtonItem属性,例如:
UIBarButtonItem *temporaryBarButtonItem = [[UIBarButtonItem alloc] init]; temporaryBarButtonItem.title = NSLocalizedString(@"MAIN", @"Back bar button item to go back to the main view controller"); self.navigationItem.backBarButtonItem = temporaryBarButtonItem;
检查UINavigationItem类引用以确保将上面的代码放在正确的视图控制器中,尤其是这部分:
当此导航项位于堆栈顶部项目的正下方时 ,导航控制器将从此导航项目中导出导航栏的后退按钮。
You need to create your own bar button item and assign it to the previous view controller navigationItem backBarButtonItem property, for example:
UIBarButtonItem *temporaryBarButtonItem = [[UIBarButtonItem alloc] init]; temporaryBarButtonItem.title = NSLocalizedString(@"MAIN", @"Back bar button item to go back to the main view controller"); self.navigationItem.backBarButtonItem = temporaryBarButtonItem;
Check the UINavigationItem class reference to make sure you put the codes above in the correct view controller, especially this part:
When this navigation item is immediately below the top item in the stack, the navigation controller derives the back button for the navigation bar from this navigation item.
相关问答
更多-
在要返回的视图控制器中,添加到viewDidLoad(): if let title = navigationController?.navigationBar.topItem?.title { let barItem = UIBarButtonItem(title: title, style: .plain, target: nil, action: nil) barItem.setTitleTextAttributes([NSAttributedStringKey.foregroundC ...
-
如何更改UINavigationController的后退按钮名称?(How to change the UINavigationController back button name?)[2023-10-19]
在viewWillAppear写这个 self.navigationItem.title = @"List View"; 而在ViewWilldisapper中写这个 self.navigationItem.title = @"Back"; 它没有故事板。 In viewWillAppear write this self.navigationItem.title = @"List View"; And in ViewWilldisapper write this self.navigationIte ... -
按UINavigationController的后退按钮执行动作(Execute action when back bar button of UINavigationController is pressed)[2022-03-28]
一个选择是实现您自己的自定义后退按钮。 您需要将以下代码添加到viewDidLoad方法中: - (void) viewDidLoad { [super viewDidLoad]; self.navigationItem.hidesBackButton = YES; UIBarButtonItem *newBackButton = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStyleBord ... -
从此链接 : self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Custom Title" style:UIBarButtonItemStylePlain target:nil action:nil]; 泰勒在评论中说: 不要在可见视图控制器中执行此操作,但在视图控制器中,如果您点击后退按钮,您将看到 From this ...
-
我会尽力交换这两条线 [self setTitle:@"Real Title"]; [super viewWillAppear:animated]; 让你得到 [super viewDidAppear:animated]; [self setTitle:@"Real Title"]; 我会把它们放到viewDidAppear中。 I would try to exchange the two lines [self setTitle:@"Real Title"]; [super vi ...
-
问题在于 dismissModalViewControllerAnimated 我不得不使用 [self.navigationController dismissModalViewControllerAnimated:YES]; [self.navigationController popToRootViewControllerAnimated:NO]; THE PROBLEM was in dismissModalViewControllerAnimated I HAD TO ...
-
您需要创建自己的条形按钮项并将其分配给先前的视图控制器navigationItem backBarButtonItem属性,例如: UIBarButtonItem *temporaryBarButtonItem = [[UIBarButtonItem alloc] init]; temporaryBarButtonItem.title = NSLocalizedString(@"MAIN", @"Back bar button item to go back to the main view control ...
-
将viewDidLoad的push / present放到viewWillAppear或viewDidAppear以便viewController可以正确初始化它的子视图以避免问题:D Put the push/present from viewDidLoad to viewWillAppear or viewDidAppear so that the viewController can init it's subview correctly to avoid problem :D
-
您必须将导航控制器视为一堆导航控制器,每个导航控制器都控制着一个充满信息的屏幕。 你用这个实例化导航控制器 -(id)initWithRootViewController:(UIViewController *)rootViewController 方法。 您在此调用中指定了根视图控制器。 然后,将导航控制器的视图作为子视图添加到窗口中,就像以前一样。 如果你想显示你的第二个屏幕,你可以使用另一个视图控制器 -(void)pushViewController:detailViewController an ...
-
如何隐藏UINavigationController的后退按钮?(How to hide the Back Button of UINavigationController?)[2022-02-23]
使用this.NavigationItem.SetHidesBackButton(true,true); 在控制器内,它被推入导航控制器。 您可以覆盖ViewWillAppear并将代码放在那里: public override void ViewWillAppear (bool animated) { base.ViewWillAppear (animated); this.NavigationItem.SetHidesBackButton(true,true); } 希望能帮助到你 ...