草庐IT

enable-welcome-root

全部标签

ios - 如何在 Objective C 中以编程方式设置 Root View Controller ?

我是iOS开发的新手,正在尝试学习如何以编程方式创建和设置View。我正在尝试在Obj-C中做快速声明window?.rootViewController=UINavigationController(rootViewController:ViewController())项目:单View应用程序。尝试链接默认创建的ViewController.h根据KrunalsAnswer,我更新了代码,但模拟器中未显示导航ControllerCmd+ClickController不会导航到ViewController文件#import"AppDelegate.h"#import"ViewCont

iphone - 使用 UITableView 和 paging.enabled=YES(或其他方式?)设置页面大小

我正在努力解决这个问题,虽然我接近解决方案,但我猜我遗漏了一些东西。情况是这样的:我的UITableView有30个单元格和一个节标题(如果它有用的话......)。表格大小恰好是3行的大小。任务:让用户每次滚动3行,恰好3行。我设置了pagingEnabled=YES。发生的事情是:“第1页”-3行-好的(第0-2行)滑动到“第2页”-接下来的3行-确定(第3-5行)滑动到“第3页”-分页效果不佳,要么跳过第6行并显示第7-9行或页面停止在6的单元格中间(也尝试移动滚动以使用滚动结束事件完成单元格可见性,但它跳过某些页面上的某些行)关于如何解决这种情况,每页=3行,不跳过或显示一半的

ios - 在 Game Center Enabled App 中处理 iOS Game Center App 中的选定回合/游戏

我正在创建一个支持GameCenter的GKTurnBasedMatch应用程序。我已经成功实现了GKLocalPlayerListener方法来监听事件,比如player:receivedTurnEventForMatch:didBecomeActive:等方法。此外,如果用户点击GKTurnBasedMatchmakerViewController中的现有匹配项(例如,如果showExistingMatches设置为YES),我可以在GKTurnBasedMatchmakerViewControllerDelegate方法turnBasedMatchmakerViewControl

ios - Xcode 7 beta ios 9 给出错误 'Application windows are expected to have a root view controller at the end of application launch'

这是我的代码。我也在使用MTStatusBarOverlay。此代码在使用xcode6运行时正常工作。应用程序崩溃并给出错误'Applicationwindowsareexpectedtohavearootviewcontrollerattheendofapplicationlaunch'.我尝试过以多种不同的方式设置rootViewController。我什至尝试覆盖MTStatusBarOverlay中的以下代码-(UIViewController*)rootViewController{ETAppDelegate*delegate=(ETAppDelegate*)[UIAppli

ios - 使用 Localizable.strings 而不是 Root.strings 本地化 Settings.bundle

由于在我的应用程序中自动下载本地化文件,我想知道是否可以使用Localizable.strings而不是在Settings.bundle中本地化Root.plistRoot.strings 最佳答案 要使用Localizable.strings,我们必须使用NSLocalizedString来引用。LocalizingYourApp和ImplementinganiOSSettingsBundle这两个文档都没有提到这种方法。据我了解,Settings.bundle将在安装时复制到应用程序文件夹之外的系统文件夹中。您的应用无法访问此文

iOS 8.4 : Scroll view resets contentOffset with Voice Over enabled shortly after view appear

在启用旁白的情况下,ScrollView会在View出现后一秒重置其预设的contentOffset。它发生在iOS8.4设备上,9.0没有重现。看起来一些内部UIScrollViewAccessibility代码强制ScrollView到setContent:当成为焦点时为零。没有找到任何方法来规避这一点。有什么想法吗?相关代码示例说明了该错误。只需创建一个带有CollectionView的View,创建一个重用ID为“Cell”的单元格,并在其上放置一个标签。@interfaceViewController()@property(nonatomic,weak)IBOutletUIC

ios - 弹出到 Root View 后推送 UIViewController

我有一个使用Storyboard和导航Controller的应用程序。在我的应用程序流程的某个阶段,我在View堆栈上获得了大约四个View,此时我必须弹出所有View,直到到达RootView。之后我需要手动推送另一个View。我尝试过各种方法,但都不走运。我尝试使用内置API调用:[self.navigationControllerpopToRootViewControllerAnimated:YES];此时我尝试通过引用RootView并调用segue方法来调用推送segue。RootView*obj=[[RootViewalloc]init];[objcallSegue];或者

javascript - iOS 12.2 : device orientation data still blocked even after manual enabling in settings

在iOS12.2中,Apple默认阻止访问设备方向数据。现在必须手动启用它(-__-),如here所述.问题是,即使在设置中启用“Motion&OrientationAccess”之后,当我尝试在deviceorientation事件上设置监听器时,我在Safari调试器上收到了这条警告消息:functiononDeviceOrientationChange(e){console.log(e)}window.addEventListener("deviceorientation",onDeviceOrientationChange,false);//--->Blockedattempt

ios - 在 iOS7 UITabbarController 中,如何停止在点击已选择的 tabBarItem 时将 navigationController 重置为 root?

我有一个UITabBarController作为iPad应用程序Storyboard中的rootViewController。它包含3个tabBarItem。每个项目都有一个navigationController。所以总共有3个navigationController。场景:我选择了第二个tabBarItem。然后,第二个navigationController将在tabBarController上可见,并带有其关联的rootController的View。我在这个可见的navigationController上推送了一些Controller。现在,当我点击第二个tabBarItem

ios - 如何有条件地为导航 Controller 设置 Root View Controller

我有一个导航Controller,根据我的应用程序的状态,它应该有不同的根。我如何在InterfaceBuilder中对此进行建模?我已将UINavigationController拖到我的Storyboard中。现在我需要连接到两个ViewController。遗憾的是我只能将一个设置为RootViewController。我是否需要对导航Controller进行子类化并根据状态重置RootViewController?解决此类问题的最佳做法是什么?在InterfaceBuilder中可视化这种关系会很好。在此先感谢您的帮助。 最佳答案