- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在我的应用程序中,我从登录屏幕导航到一个类 classA ,就像这样
classA *objUserHome = [[classA alloc]init];
[self presentModalViewController:objUserHome animated:YES];
[objUserHome release];
ClassA 有一个导航栏和一个标签栏(里面有 5 个标签),我已经像这样以编程方式创建了我的标签栏
- (void)viewDidLoad
{
[super viewDidLoad];
//Create tab bar controller and navigation bar controller
tabBarController = [[UITabBarController alloc] init];
NSMutableArray *arrControllers = [[NSMutableArray alloc] initWithCapacity:5];
//Add PunchClock to tab View Controller
PunchClock* objPunchClock = [[PunchClock alloc] initWithTabBar];
NavigationController = [[UINavigationController alloc] initWithRootViewController:objPunchClock];
NavigationController.navigationBar.tintColor = [UIColor brownColor];
[arrControllers addObject:NavigationController];
[NavigationController release];
[objPunchClock release];
//Add Time_Sheet to tab View Controller
Time_Sheet* objTime_Sheet = [[Time_Sheet alloc] initWithTabBar];
NavigationController = [[UINavigationController alloc] initWithRootViewController:objTime_Sheet];
NavigationController.navigationBar.tintColor = [UIColor brownColor];
[arrControllers addObject:NavigationController];
[NavigationController release];
[objTime_Sheet release];
//Add PTO to tab View Controller
PTO* objPTO = [[PTO alloc] initWithTabBar];
NavigationController = [[UINavigationController alloc] initWithRootViewController:objPTO];
NavigationController.navigationBar.tintColor = [UIColor brownColor];
[arrControllers addObject:NavigationController];
[NavigationController release];
[objPTO release];
//Add PunchClock to tab View Controller
CrewPunch* objCrewPunch = [[CrewPunch alloc] initWithTabBar];
NavigationController = [[UINavigationController alloc] initWithRootViewController:objCrewPunch];
NavigationController.navigationBar.tintColor = [UIColor brownColor];
[arrControllers addObject:NavigationController];
[NavigationController release];
[objCrewPunch release];
//Add PunchClock to tab View Controller
Reports* objReports = [[Reports alloc] initWithTabBar];
NavigationController = [[UINavigationController alloc] initWithRootViewController:objReports];
NavigationController.navigationBar.tintColor = [UIColor brownColor];
[arrControllers addObject:NavigationController];
[NavigationController release];
[objReports release];
// Add this view controller array into the tab bar
//self .viewControllers = arrControllers;
tabBarController .viewControllers = arrControllers;
[arrControllers release];
[self.view addSubview:[tabBarController view]];
}
而ClassA是继承自UIViewController
现在的问题是,在导航到 classA 之后,classA 的 View 向下移动了大约 4mm 为什么会这样??我该如何解决这个问题,请提前帮助我,谢谢
最佳答案
在 2 个或更多 View 之间使用 Storyboard和Modal Transition
时,您可能会遇到与上述类似的错误。
如果您使用从 ViewControllerA
到 ViewControllerZ
的 Modal Transition
,然后尝试从 进行
回到 Modal Transition
ViewControllerZViewControllerA
有时 ViewControllerA
的 View 会稍微向下推窗口。
这可以通过以下方式阻止:
[self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
在 ViewControllerZ
上从 ViewControllerZ
上的事件返回到 ViewControllerA
关于iphone - 包含导航栏和标签栏的 View 向下移动了大约 4mm,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11389244/
如果我只知道一个 id,有没有办法在一个查询中向上/向下移动列表项 像这样的 update tbl SET list_order = CASE WHEN id = 10
我有两个并排的表格 View ,当我在两个表格中的任何一个上滚动时,我使用下面的代码使它们像一个表格一样滚动。 func scrollViewDidScroll(_ scrollView: UIScr
我知道这看起来应该很简单,但由于某种原因,我无法理解解决这个问题的算法,所以我将就这个问题与社区联系。 我有一个如下所示的类: class MapElementModel { int id;
我目前正在使用 Visual Studio 使用 C# 编写应用程序。因此,VS2010 创建了一个解决方案目录,其中包含我的项目目录。所以我的层次结构是这样的: Solution .git
我正在制作一个应用程序,在显示键盘时向上移动 View (当 iPhone 4s/5/5c/5s 时)。但是,当我使用数字 pa 键入内容时,它会触发 View 返回。 textField:shoul
我正在处理以前开发人员的遗留代码,他们使用的是 highcharts.js (v3.0.1)。 xAxis 落在图中 ( screenshot ),我无法弄清楚这是为什么。我试图在 jsfiddle
当显示标签栏时,我想向下移动我的 View Controller 内容(即整个 View )。有什么办法可以自动完成吗?还是必须以编程方式完成? 最佳答案 解决方案很简单。只需取消选中 Interfa
我最近升级到 Xcode 9-beta 和 iOS 11。当我升级到我的项目并插入播放时,我的所有 View 都被状态栏向下推了大约 20 像素,而不是状态栏直接在我的顶部看法。我有 iOS 10 的
当我使用 调用 AdMob 广告时遇到此问题 [rootController.view addSubview:adMobAd]; //setup the ad 从点击的广告返回后,AdMob 框架会向
我目前正在创建一个应用程序,它在一个 View 中包含一个 pickerView 和一个 tapbar。 View 位于屏幕底部。 tapbar 总是可见的。如果我点击 tapbar 上的按钮, Vi
我是一名优秀的程序员,十分优秀!