如何以编程方式设置导航栏的位置

问题描述 投票:0回答:2

如何以编程方式设置导航栏的位置? Autolay已被关闭,因为它导致其他IOS问题。干杯伙计们。

[我的布局]

View Controller
   View
     Toolbar
     WebView
     Navigation Bar
      Nav Item
   First Responder
   Exit

导航栏当前出现在屏幕的底部而不是我想要的顶部。

iphone ios uinavigationbar
2个回答
3
投票

试试这个

[self.navigationController.navigationBar setFrame:CGRectMake(x,y,width,height)];


0
投票

如果您使用的是Interface Builder,只需将导航栏拖动到所需的位置即可

© www.soinside.com 2019 - 2024. All rights reserved.