草庐IT

UiviewController

全部标签

ios - iOs Xcode 中的 UIViewController 中的 UIView 中的 UITableView

我想在xcode中实现以下功能。我有一个ViewController。在这个UIViewController中,我有一个UITabBar。它们下面是一个UIView。将UITableView添加到UIView的最佳方法是什么?然后能够单击UITableViewCell并打开另一个UIViewController以显示有关UITableViewCell的更多信息?这是我的Storyboard的当前设置:你能给我一个解决这个问题的方法吗?谢谢 最佳答案 您需要解决问题的方法,但我不确定您的问题是什么。在Storyboard中,将UIVi

ios - 如何将以编程方式创建的 View Controller 的 View 设置为 SKYView?

我正在开发一款游戏,希望一个sprite-kit场景有自己的ViewController(这是我经过多次辩论后得出的结论),并且希望避免使用Storyboard(我可以用Storyboard,但想学习如何在没有Storyboard的情况下进行操作)。在我的主视图Controller中,单击一个按钮后,我有以下代码MyViewController2*test=[[MyViewController2alloc]init];test.view=[[SKViewalloc]init];[selfpresentViewController:testanimated:YEScompletion:n

ios - 从 subview 中的父 View Controller 检索数组

因此,在过去的几天里,我似乎一直在尝试为此寻找各种解决方案,并决定最好还是问问别人。我正在使用Storyboard,我将一个数组从一个ViewController发送到另一个就好了。但是一旦进入这个SecondViewController,我就会遇到问题。然后我希望能够访问此ViewController的subview中的数组,以便能够使用数据绘制图形,但每当我尝试时,我总是从subview中的代码中获取null,即使它肯定在ParentViewController中.有人可以看看我当前的代码,让我知道如何在我的subview中获取这些数据。ParentViewController.h

ios - iOS 中的 -(CGRect *)frame 方法是什么?

代码:if(!CGRectContainsPoint([[viewArrayobjectAtIndex:0]frame],CGPointMake(newX,newY))){....}问题我想在View数组中获取UIView的“框架”值,所以我使用了这个:((UIView*)[viewArrayobjectAtIndex:0]).frame我利用(UIView*)强制将id对象转换为UIView,否则会触发错误,如“在类型为‘id’的对象上找不到属性‘frame’”。但是下面的方法似乎成功地摆脱了这个错误:[[viewArrayobjectAtIndex:0]frame]所以[idfra

ios - 你能在 UIViewController 类中实现辅助功能方法吗?

我在UIViewController子类中实现了辅助功能委托(delegate)方法,并在这些委托(delegate)方法中放置了一个断点,但它从未到达断点。这是什么原因?如果有人对此有任何想法,请告诉我。 最佳答案 UIAccessibility协议(protocol)中的方法旨在描述可访问的屏幕元素,而不是逻辑代码块或整个屏幕。辅助功能客户端将查询您的用户界面以获取描述,因此您需要在UIView子类上实现该协议(protocol)。请考虑浏览AccessibilityProgrammingGuideforiOS了解iOS上的辅助

ios - 将数据从 Viewcontroller 传输到 UIview

我正在尝试使用在UIView中绘制图形-(void)drawRect:(CGRect)rect{[superdrawRect:rect];CGContextMoveToPoint(context,0f,0f);CGContextAddLineToPoint(context,Value1,0);CGContextStrokePath(context);}如果我在我的UIView.m中定义Value1它可以工作但是:Value1应该从另一个ViewController传输,我在其中将Value键入文本字段。如何将值1传输到我的UIView中?(我可以将值转移到另一个ViewControll

ios - 如何处理来自应用程序委托(delegate)的 UIViewcontroller 中的通知?

我收到通知appdelegatedidReceiveRemoteNotification但我想在ViewController中使用此有效负载数据,该怎么做? 最佳答案 有很多方法可以做到这一点,这个问题有点含糊。假设您的应用程序中有一个ViewController,它在您的通知到达时处于事件状态,也许最简单的方法是使用NSNotification将有效负载从应用程序委托(delegate)广播到您感兴趣的ViewController。在你的ViewController中:[[NSNotificationCenterdefaultCe

ios - UIPageViewController 与多个 UIViewController 与标题和底栏

我用多个UIViewController做了一个UIPageViewController。现在,我需要在UIPageViewController的顶部和底部添加一个固定的UIView...这是我的代码:-(void)viewDidLoad{[superviewDidLoad];//Createit.self.pageController=[[UIPageViewControlleralloc]initWithTransitionStyle:UIPageViewControllerTransitionStyleScrollnavigationOrientation:UIPageViewC

ios - ' fatal error : NSCoder not supported' when using UIViewController

当我尝试运行连接到默认GameScene.swift文件的ViewController之一时出现以下错误。fatalerror:不支持NSCoder:requiredinit(coderaDecoder:NSCoder){fatalError("NSCodernotsupported")}我打算使用SpriteKit,因此系统提示我使用必需的初始化程序,但我不确定为什么这会导致问题。 最佳答案 您不应该使用requiredinit(coderaDecoder:NSCoder)进行初始化,除非您已经实现了它(这是一个wholediff

ios - UINavigationView不能弹出,只有导航弹出动画,UIViewController没变

我使用自定义UINavigationController作为rootViewController。UINavigationController的第一个viewController是一个UITabBarController。每个UITabBarController都是自定义的UINavigationConller。当显示tabBarController时,我隐藏了rootViewController的navigationBar.InittheUITabbarController+(RDVTabBarController*)tabBarControllertWithIndex:(NSUIn