草庐IT

Star-Size

全部标签

ios - 是否有 (self.frame.origin.y + self.frame.size.height) 的快捷方式?

我写了太多这段代码:self.frame.origin.y+self.frame.size.height有捷径吗?像self.frame.y_plus_height这样的东西?如果有,我不确定在我写下完整句子的所有时间里这是好消息还是坏消息。 最佳答案 这应该可以解决问题:CGFloatres=CGRectGetMaxY(self.frame);可以找到文档here.编辑:根据robmayoff的解释(见评论),这比在代码中简单地求和origin.y+size.height要昂贵一些。

ios - 使用 loadNibNamed 和 Size Classes 获取约束

我正在使用自动布局和大小类从xib加载View。在该View中有一个subviewviewWithSizeClasses,其高度限制取决于大小类。我想做的是在loadNibNamed之后立即加载约束,以便根据当前SizeClass获得正确的高度。我尝试了layoutSubviews()、updateConstraints()的各种组合,但无论我做什么,我总是得到默认的Any,Any高度。overridefuncviewDidAppear(animated:Bool){super.viewDidAppear(animated)letxibView=NSBundle.mainBundle(

ios - ERROR : BOMStream BOMStreamWithFileAndSys(int, off_t, size_t, int, char *, BomSys *): read: No such file or directory in iOS

我正在从我的服务器下载一个mp4文件。昨天还好。现在我遇到了这个错误:BOMStreamBOMStreamWithFileAndSys(int,off_t,size_t,int,char*,BomSys*):read:Nosuchfileordirectory我的下载突然完成并显示进度:-80%下面是我的输出:2016-04-2811:07:43.816NSURLSample[10581:112570]BOMStreamBOMStreamWithFileAndSys(int,off_t,size_t,int,char*,BomSys*):read:Nosuchfileordirecto

ios - Compact Width in Size Classes 中的 "Regular Height"和 "Any Height"有什么区别?

在CompactWidth中,在AnyHeight中声明的NSLayoutConstraints与应用于RegularHeight类。这些类之间有什么区别? 最佳答案 我想这可能只是语义上的区别。如果你为横向iPhone创建了一个CompactHeight布局,那么你就不能再称纵向iPhone为“任何”了,是吗?此外,还有用于紧凑/常规宽度的用例,因此将紧凑/常规高度作为配对只会保持系统平衡和一致。最后的想法——这为future具有不同外形的设备留下了灵active。该选项已经存在。 关

ios - 转换矩形 : toView: returns double size and twice the distance from the origin

我将ImageView传递给需要ImageView大小的初始化方法。然后调用convertRect:toView:-(id)initWithImageView:(UIImageView*)imageView{self=[superinit];if(self){CGRectimageViewFrame=[[imageViewsuperview]convertRect:imageView.frametoView:self.view];}}调用方式:MyViewController*viewController=[[MyViewControlleralloc]initWithImageVie

ios - MonoTouch项目导致Application Loader报错 "icon dimensions (0 x 0) don' t meet the size requirements”

我在MonoTouch上编译了一个iOS应用程序以供分发。现在我尝试使用ApplicationLoader在AppStore上获取它。但我收到一条错误消息“...图标尺寸(0x0)不符合尺寸要求...”。在这个论坛上,我发现其他开发人员对XCode有同样的问题。他们的解决方案是禁用png文件的压缩。但是我如何在MonoTouch中执行此操作?有人知道这个问题吗? 最佳答案 Jörn解决了他的问题,但这里是其他人的完整步骤。错误:icondimensions(0x0)don'tmeetthesizerequirements是OSX10

ios - -scrollRangeToVisible : doesn't take keyboard size into account in iOS 7

我一直在我的ViewController中使用以下代码来在显示键盘时更新UITextView的内容偏移量:-(void)keyboardWasShown:(NSNotification*)notification{NSDictionary*info=[notificationuserInfo];CGRectkeyboardRect=[[infoobjectForKey:UIKeyboardFrameEndUserInfoKey]CGRectValue];UIEdgeInsetscontentInsets=UIEdgeInsetsMake(0.0,0.0,keyboardRect.siz

android - OutOfMemoryError : bitmap size exceeds VM budget :- Android

这个问题在这里已经有了答案:关闭10年前.PossibleDuplicate:Android:StrangeoutofmemoryissuewhileloadinganimagetoaBitmapobject我正在从Url下载图像并显示它们。在下载时它给内存不足错误:位图大小超出VM预算。我正在使用可绘制的。代码如下:HttpClienthttpclient=newDefaultHttpClient();HttpResponseresponse=(HttpResponse)httpclient.execute(httpRequest);HttpEntityentity=response

android - OutOfMemoryError : bitmap size exceeds VM budget :- Android

这个问题在这里已经有了答案:关闭10年前.PossibleDuplicate:Android:StrangeoutofmemoryissuewhileloadinganimagetoaBitmapobject我正在从Url下载图像并显示它们。在下载时它给内存不足错误:位图大小超出VM预算。我正在使用可绘制的。代码如下:HttpClienthttpclient=newDefaultHttpClient();HttpResponseresponse=(HttpResponse)httpclient.execute(httpRequest);HttpEntityentity=response

iphone - 为什么 self.bounds.size.height 没有考虑这段代码中的 UINavigationView 导航栏?

我有一个配置UITableView,可以通过UINavigationController方法启动颜色选择器:[self.navigationControllerpushViewController:colorPickerViewControlleranimated:YES];[colorPickerViewControllerrelease];这意味着ColourPicker的顶部将有一个导航栏(和后退按钮)ColourPickerViewControll及其ViewColourPickerView的结构如下:-ColourPickerViewController-init'sXIBf