首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏梧雨北辰的开发录

    iOS布局之AutoresizingMask和AutoLayout

    subView.backgroundColor = [UIColor purpleColor]; [superView addSubview:subView]; //设置子视图的宽度随着父视图变化 subView.autoresizingMask 该属性表示autoresizingMask和autolayout两种方式的转换。这个属性对于在代码中生成的view来说默认是true,而对于IB中拖出来的view来说默认是false. 在实际的使用过程中,我还需要注意两点: 1.当我们设置这个属性为YES的时候,view的布局结果由AutoResizingMask,frame,center这些因素共同决定,如果再在其上添加AutoLayout

    2.3K60发布于 2018-04-24
  • 来自专栏xamarin

    Xamarin.iOS(百分比进度条)网络图片加载

    bigRadialProgressView.Center = new PointF (View.Center.X, View.Center.Y - 100); bigRadialProgressView.AutoresizingMask bigRadialProgressView.Frame.Left / 2, bigRadialProgressView.Center.Y); smallRadialProgressView.AutoresizingMask bigRadialProgressView.Frame.Right) / 2, bigRadialProgressView.Center.Y); tinyRadialProgressView.AutoresizingMask 30, bigRadialProgressView.Frame.Bottom + 80, View.Frame.Width - 60, 10); standardProgressView.AutoresizingMask startProgressButton.SetTitle ("Start Progress", UIControlState.Normal); startProgressButton.AutoresizingMask

    1.4K00发布于 2021-05-20
  • 来自专栏一“技”之长

    iOS界面布局之一——使用autoresizing进行动态布局

    一、通过代码进行布局 任何一个view都有autoresizingMask这个属性,通过这个属性可以设置当前view与其父视图的相对关系。 greenColor];     [view1 addSubview:view2];     [self.view addSubview:view1]; } 设置view2的自动布局属性如下:  view2.autoresizingMask 设置如下:    view2.autoresizingMask=UIViewAutoresizingFlexibleHeight; 效果如下: ? 如下设置: view2.autoresizingMask=UIViewAutoresizingFlexibleLeftMargin; 效果如下: ? 这时子视图的左边是随父视图变化而可变的。 注意:这些自动布局的属性是可以叠加的,比如保持视图与父视图边距不变,如下设置: view2.autoresizingMask=UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight

    98520发布于 2018-08-16
  • 来自专栏传统基础应用开发专栏-不限开发语言

    完整的苹果内购in-purchase实例-采用object-c语言使用苹果的Storyboard开发模式的完整购买实例

    key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews key="<em>autoresizingMask</em>"/> <fontDescription key="fontDescription key="autoresizingMask"/> <fontDescription key="fontDescription key="autoresizingMask"/> <fontDescription key="fontDescription key="autoresizingMask"/> <fontDescription key="fontDescription" type=

    58010编辑于 2025-09-12
  • 来自专栏君赏技术博客

    Jekyll-Admin-Mac 开发纪要-左侧菜单栏

    下载命令 使用 Xib 使用 Autolayout OSX开发 @IBDesignable和@IBInspectable draw() 自定义NSView的背景颜色 使用 Xib 加载试图 设置 autoresizingMask 设置 autoresizingMask属性 我们设置一下 autoresizingMask属性。关于 autoresizingMask一些用法可以看一下下面的资料。 iOS开发-自动布局之autoresizingMask使用详解(Storyboard&Code) 我们设置高度自适应。 self.view.autoresizingMask = .viewHeightSizable 我们设置 SideMenuView的view的背景为rgb515151,方便我们进行查看。 ? self.view.autoresizingMask = [.viewWidthSizable,.viewHeightSizable] 这里说明一点,可选型不是如Objective-C 那样一般用|连接

    3.1K10发布于 2018-08-31
  • 来自专栏TechBox

    深入详解iOS适配技术

    那么autoresizingMask又是什么呢? autoresizingMask是一个枚举值,作用是自动调整子控件与父控件中间的margin(间距)或者子控件的宽高。 值得注意的是:autoresizingMask的枚举值是使用位移的形式给出的,这样设置的好处在于,当我们使用代码给某个视图设置autoresizingMask属性时,我们可以给autoresizingMask 不难发现,这样以位移的方式指定autoresizingMask枚举值,也契合了storyboard中可以给子控件设置多个方向的约束的情景。如下图: ? 注意:UIView的autoresizesSubviews属性为YES时(默认为YES),autoresizingMask才会生效。 也就是说,当我们想要利用autoresizingMask指定某个控件和其父控件的关系时候,必须autoresizesSubviews = YES。

    9.7K70发布于 2018-06-05
  • 来自专栏ShaoYL

    iOS---小经验分享

    解决办法:取消autoresizingMask 且通过xib创建的视图,self.view.bounds 不是屏幕那个尺寸 - (void)awakeFromNib { self.autoresizingMask view上时,尺寸设置self.view.bounds;会被拉伸,若不被拉伸用以下语句 scrollView.frame = self.view.bounds; scrollView.autoresizingMask

    90260发布于 2018-05-11
  • 来自专栏全栈程序员必看

    IOS开展:导航中添加多个button并加入左侧logo

    = [[UIImageView alloc] init]; img.image = [UIImage imageNamed:@"oatosLogo.png"]; img.autoresizingMask

    74210编辑于 2022-07-06
  • 来自专栏码客

    iOS 使用WKWebView

    self.webouterView.bounds, configuration: webConfiguration) self.webouterView.addSubview(myWebView) myWebView.autoresizingMask = UIView.AutoresizingMask.flexibleWidth let web_url = URL.init(string: weburl) myWebView.load(URLRequest.init

    2K10发布于 2019-10-21
  • 来自专栏浮躁的喧嚣

    iOS-屏幕适配实现(Autoresizing)

    nonatomic) BOOL autoresizesSubviews; // 默认为YES,代表父控件会跟随子控件尺寸的变化而变化 @property(nonatomic) UIViewAutoresizing autoresizingMask UIViewAutoresizingFlexibleBottomMargin = 1 << 5 //与父视图上边间距固定,下边可变 }; 注意:UIView的autoresizesSubviews属性为YES时(默认为YES),autoresizingMask 才会生效,也就是说,当我们想要利用autoresizingMask指定某个控件和其父控件的关系时候,必须autoresizesSubviews = YES。

    1K10编辑于 2023-11-22
  • 来自专栏jonny

    低代码调研与思考

    id="c22-O7-iKe"> <rect key="frame" x="0.0" y="0.0" width="480" height="272"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <subviews> > <rect key="frame" x="156" y="177" width="75" height="32"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/> <buttonCell key="cell

    1.7K40编辑于 2022-12-05
  • 来自专栏张志敏的技术专栏

    Xcode 5 中 xib 文件格式的调整

    scaleToFill" id="1"> <rect key="frame" x="0.0" y="0.0" width="320" height="568" /> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" /> <color key="backgroundColor

    1.7K20发布于 2020-08-10
  • 来自专栏冰霜之地

    WWDC2016 Session笔记 - Xcode 8 Auto Layout新特性

    如下图,我们这个时候在“Show the Size inspector”面板上面就已经看不到AutoresizingMask的设置面板了。 先是粉色的父View,我们给它加上如下的AutoresizingMask。 给"雨天"的imageView加上如下AutoresizingMask 给"阴天"的imageView加上如下的AutoresizingMask ? 最后给我们的中间的Label加上AutoresizingMask 这个时候我们旋转一下屏幕,一切正常,View的排版都如我们所愿。 ? 注意这个时候右边还是AutoresizingMask的面板,因为这个时候Label还没有任何的constraint。

    1.1K30发布于 2018-08-30
  • 来自专栏KyXu

    【iOS开发】生成高斯模糊效果背景

    blurImageView.contentMode = UIViewContentMode.ScaleAspectFill //使图片充满ImageView blurImageView.autoresizingMask

    2.7K20发布于 2019-04-11
  • 来自专栏移动端开发

    iOS 转场动画探究(二)

    UIView * presentedViewControllerView = [super presentedView]; presentedViewControllerView.autoresizingMask presentationWrapperView.bounds, UIEdgeInsetsMake(0, 0, -CORNER_RADIUS, 0))]; // autoresizingMask 这个属性 自动调整与父视图之间的边界距离 presentationRoundedCornerView.autoresizingMask = UIViewAutoresizingFlexibleWidth dimmingView.backgroundColor = [UIColor blackColor]; dimmingView.opaque = NO; dimmingView.autoresizingMask

    1.7K70发布于 2018-01-15
  • 来自专栏移动端开发

    iOS 转场动画探究(二)

    UIView * presentedViewControllerView = [super presentedView]; presentedViewControllerView.autoresizingMask presentationWrapperView.bounds, UIEdgeInsetsMake(0, 0, -CORNER_RADIUS, 0))]; // autoresizingMask 这个属性 自动调整与父视图之间的边界距离 presentationRoundedCornerView.autoresizingMask = UIViewAutoresizingFlexibleWidth dimmingView.backgroundColor = [UIColor blackColor]; dimmingView.opaque = NO; dimmingView.autoresizingMask

    1.1K40发布于 2018-07-31
  • 来自专栏mukekeheart的iOS之旅

    OC中的一些编程写法--({"添加代码"}) 花括号用法

    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 40, 100, 100)]; imageView.autoresizingMask

    1.1K20发布于 2021-03-17
  • 来自专栏音视频技术学习笔记

    音视频技术(3)- 入门DEMO

    initWithContentURL:url]; _moviePlayer.view.frame = self.view.bounds; _moviePlayer.view.autoresizingMask

    1.2K20发布于 2020-03-27
  • 来自专栏非典型技术宅

    iOS屏幕适配概述1 屏幕适配简介2 Autoresizing3 Auto Layout

    2.1.1 外面四根线 表示子控件距离父控件的四周边距是否固定 2.1.2 里面两根线 子控件的宽高是否随着父控件的宽高变化 2.2 代码中使用Autoresizing AutoresizingMask redView.AutoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 3 Auto

    1.7K30发布于 2018-06-28
  • 来自专栏freesan44

    关于Autolayout和Masonry自动布局的几个坑

    translatesAutoresizingMaskIntoConstraints 默认为YES,也就是按照默认的autoresizingMask 进行计算;设置为NO之后,则可以使用更灵活的Autolayout lastView); // bottom = lastView}]; 不过对于我的项目来讲计算的太蛋疼了,于是偷了个懒,因为从pageview往里的每个view都是撑满父视图的,所以也就可以使用默认的autoresizingMask

    2.2K20发布于 2018-09-05
领券