`
sinye
  • 浏览: 217613 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

iOS view的frame和bounds的区别

    博客分类:
  • iOS
 
阅读更多

详情:http://blog.csdn.net/mad1989/article/details/8711697

总结如下:

(1)frame: 该view在父view坐标系统中的位置和大小。(参照点是,父亲的坐标系统)

     bounds:该view在本地坐标系统中的位置和大小。(参照点是,本地坐标系统,就相当于自己的坐标系统,以0,0点为起点),除了手动设置bounds,默认是以0,0为起点。

(2)view的位置,由view.frame来决定,view.bounds决定的是其内子视图的原点。

 

 

分享到:
评论

相关推荐

    iOS view的frame和bounds之区别.pdf

    iOS view的frame和bounds之区别.pdf

    ios-国际化和本地化(支持英语单复数问题).zip

    默认UITableView是UITableViewStyleGrouped组模式,Frame是self.view.bounds的大小,继承者可重写setBaseTableView方法修改TableView和添加tableHeaderView和tableFooterView等属性! 内部提供可以跳转Model和基本...

    ios-时间选择器.zip

    view.frame = CGRectMake(0, self.view.bounds.size.height-240, self.view.bounds.size.width, 240); //view.dateLimitNum = 0; view.hoursType = UIHoursTypeWork; view.minutesType = UIMinutesTypeAll; ...

    ios-DMRefreshControl.com

    使用Swift,封装了一个不一样的GearRefreshControl,继承自UIRefreshControl。...,初始化:refreshControl = GearRefreshControl(frame:self.view.bounds).使用方法refreshControl.addTarget()即可。

    ios-一款简单好用的跑马灯效果-swift.zip

    1、初始化 drawMarqueeView = WQScrollLabelView(frame: CGRect(x: 0, y: 104, width: self.view.bounds.width, height: 20)) 2、设置属性 drawMarqueeView.marqueeDirection = .left view.addSubview...

    Programming.iOS.9

    The Window 4 Experimenting With Views 7 Subview and Superview 8 Visibility and Opacity 11 Frame 12 Bounds and Center 13 Window Coordinates and Screen Coordinates 17 Transform 18 Trait Collections and ...

    iOS-GridView:iOS自定义网格组件,基于UICollectionView的GridView

    MLHGridView *grid = [[MLHGridView alloc]initWithFrame:CGRectMake(10, 64, self.view.frame.size.width-20, CGRectGetHeight(self.view.bounds) - 64)]; grid.delegate = self; 2、实现delegate (NSInteger)...

    ios开发记录

    //一般使用bounds不设置x和y只设置宽和高 //center是相对于其父视图而言的,是CGpoint类型 _vi.bounds=CGRectMake(0, 0, 200, 200); // vi.center=CGPointMake(160, 240); _vi.center=_window.center; //arc4...

    ios-卡片布局-Swift.zip

    let collectionView = UICollectionView(frame: view.bounds, collectionViewLayout: layout) 可以设置的属性: //cell的尺寸 var itemSize: CGSize //cell间距 var spacing: CGFloat //缩放率 var ...

    UILoadingView:使用 Swift 编写的 iOS 全屏加载视图简单易用

    let loadingView = UILoadingView(frame: self.view.bounds) // show the loading view self.view.addSubview(loadingView) 您还可以指定要使用的自定义文本而不是“正在加载...” let loadingView = ...

    iOS中利用CAGradientLayer绘制渐变色的方法实例

    前言 以前不用自己切图,现在要自己切图,看到设计稿有好多不同规格的渐变色的背景,一个一个切的话好麻烦,没有想到iOS本来就...gradientLayer.frame = view.bounds; [gradientLayer setColors:[NSArray arrayWithObje

    iOS开发中一些手写控件及其相关属性的使用

    手写控件,frame,center和bounds属性 一、手写控件 1.手写控件的步骤 (1)使用相应的控件类创建控件对象 (2)设置该控件的各种属性 (3)添加控件到视图中 (4)如果是button等控件,还需考虑控件的单击事件等 ...

    Xamarin.iOS.iCarousel:用于iOS的简单,高度可定制的,数据驱动的3D旋转木马绑定Xamarin.iOS

    Xamarin.iOS.iCarousel 这是库的Xamarin iOS绑定。... Bounds = View . Bounds , ContentMode = UIViewContentMode . Center , Type = iCarouselType . CoverFlow2 , Frame = View . Frame , CenterItemWhen

    ios-验证码设置.zip

    TFSButton* btn = [[TFSButton alloc]initWithFrame:CGRectMake((self.view.bounds.size.widt h - 180)/2, 200, 180, 40) touchBlock:^(TFSButton *btn) { // 向服务器请求验证码 }]; [self.view addSubview:...

    ios-仿优酷视频,搜狐视频,凤凰新闻上导航滑动scrollview 以及绑定下面的viewcontroller.zip

    self.controllerScrollview = [ControllerScrollView.alloc initWithFrame:CGRectMake(0, self.topScrollview.frame.origin.y self.topScrollview.frame.size.height, [UIScreen mainScreen].bounds.size.width, ...

    ios-ZJGenWoYou.zip

    let customView = CustomSliderView.init(frame: CGRectMake(0, 0, UIScreen.mainScreen().bounds.width, 300), type: SliderViewSourceType.SourceTypeLocalSource, imageArray: imageArray, sliderTime: 3.0) ...

    iphone开发笔记

    退回输入键盘 2 CGRect 2 CGPoint & CGSize 3 设置透明度 3 设置背景色 3 自定义颜色 3 竖屏 3 横屏 3 ...iPhone里的frame和bounds区别 43 Objective-C内存管理 44 iphone更改键盘右下角按键的type 45

    KBHDatePicker:无限滚动日期选择器,类似于iOS的“日历”应用

    let frame = CGRectMake(0, 44, self.view.bounds.width, 70) let datePicker = KBHDatePicker(frame: frame) self.view.addSubview(datePicker) 执照 KBHDatePicker在MIT许可下可用。 有关更多信息,请参见LICENSE...

    轮播3d旋转

    focusView3.frame = CGRectMake(20, 20, [UIScreen mainScreen].bounds.size.width-40, [UIScreen mainScreen].bounds.size.height-40); [self.view addSubview:focusView3]; focusView3.delegate =self; ...

Global site tag (gtag.js) - Google Analytics