首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏谈补锅

    记录下UIButton的图文妙用和子控件的优先显示

    addMoveImgAndTextButton{ //1、创建一个按钮:30x50 UIButton *iconBtn = [[UIButton alloc] initWithFrame:CGRectMake addSubview:btn]; //3、移动iconBtn按钮图片和文字 UIButton *btn2 = [[UIButton alloc] initWithFrame:CGRectMake [self.view addSubview:btn2]; //分割线 UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake ]; //4.5 按钮不使用背景图片,设置背景颜色当做有背景图片 UIButton *clickBtn5 = [[UIButton alloc] initWithFrame:CGRectMake - (void)testSubControlShowFront{ //1、红色view UIView *redView = [[UIView alloc] initWithFrame:CGRectMake

    2.1K30发布于 2018-09-27
  • 来自专栏月亮与二进制

    《Motion Design for iOS》(三十六)

    // Katy Perry 行 UIImageView *firstRow = [[UIImageView alloc] initWithFrame:CGRectMake(0, 170, windowWidth addSubview:firstRow]; // Shakira 行 UIImageView *secondRow = [[UIImageView alloc] initWithFrame:CGRectMake addSubview:secondRow]; // Pitbull 行 UIImageView *thirdRow = [[UIImageView alloc] initWithFrame:CGRectMake addSubview:thirdRow]; // Lana del Rey 行 UIImageView *fourthRow = [[UIImageView alloc] initWithFrame:CGRectMake // 添加箭头和顶部的文字 UIImageView *arrowView = [[UIImageView alloc] initWithFrame:CGRectMake(windowWidth,

    77320发布于 2021-11-23
  • 来自专栏c#开发者

    ios-zbar scanview 根据扫描区域切割图片

    ZBarReaderViewController *reader = [ZBarReaderViewController new]; reader.readerDelegate = self; //CGRect frame= CGRectMake (20, 30, 320, 260); reader.scanCrop= CGRectMake(0.2, .1, .47, .8);   自定义scanview添加一个自定义的扫描框 - (UIView *)setOverlayPickerView{ UIView *v=[[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; setBackgroundColor:[UIColor clearColor]]; UILabel *scanningLabel = [[UILabel alloc] initWithFrame:CGRectMake UIImageOrientationLeft]; UIImage * PortraitImage=[largeImage imageRotatedByDegrees:90]; //CGRectMake

    1.4K70发布于 2018-04-12
  • 来自专栏iOSer成长记录

    iOS-自定义button详解

    backgroundRectForBounds:(CGRect)bounds{ NSLog(@"背景边界:%@",NSStringFromCGRect(bounds)); return CGRectMake 的大小,参数bounds是button的大小,即button.frame - 如果:`return bounds` 此时背景view和button的大小相同,是默认的大小 - 如果:return CGRectMake (0, 0, 50, 50),且button.frame = CGRectMake(0, 0, 100, 100) 此时背景view的大小是{{0,0},{50,50}},而button的大小是{{0,0 },{100,100}},在背景view之外的button是透明的且不能改变颜色,它可以响应点击事件 - 如果:return CGRectMake(0, 0, 100, 100),且button.frame = CGRectMake(0, 0, 50, 50) 此时分两种情况,一种是layer.masksToBounds = YES,button的背景view和frame都是{{0,0},{50,50}

    1.1K30发布于 2018-06-29
  • 来自专栏流川疯编写程序的艺术

    ios swift模仿qq登陆界面,xml布局

    (0,0,0,0) var m_UsernameRect = CGRectMake(0,0,0,0) var m_PassWordRect = CGRectMake( 0,0,0,0) var m_ConnectRect = CGRectMake(0,0,0,0) var m_ForgetRect = CGRectMake as String ) as NSString).floatValue) m_backgroundRect = CGRectMake as String ) as NSString).floatValue) m_UsernameRect = CGRectMake(x,y,Width,Height) as String ) as NSString).floatValue) m_PassWordRect = CGRectMake(x,y,Width,Height)

    2.5K10编辑于 2022-05-06
  • 来自专栏全栈程序员必看

    layoutSubviews 调用

    (283, 0, 239, 83)]; [leftView setFrame:CGRectMake(38, 102, 384, 272)]; [rightView setFrame:CGRectMake (450, 102, 282, 198)]; } -(void)setHorizontalFrame { NSLog(@”横屏”); [titleLable setFrame:CGRectMake (183, 0, 239, 83)]; [leftView setFrame:CGRectMake(168, 122, 384, 272)]; [rightView setFrame:CGRectMake (12, 6, 250, 125)]; [textLable setFrame:CGRectMake(50, 139, 182, 39)]; } -(void)setHorizontalFrame { NSLog(@”横屏”); [contentView setFrame:CGRectMake(12, 6, 106, 158)]; [textLable setFrame:CGRectMake

    78250编辑于 2022-09-17
  • 来自专栏DannyHoo的专栏

    视图的alpha属性可能会影响子视图的透明度

    先看代码以及效果图吧: 代码: UIView * redV = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];     redV.backgroundColor redV.alpha = 0.5;     [self.view addSubview:redV]; UILabel * lbl = [[UILabel alloc] initWithFrame:CGRectMake 代码: UIView * redV = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];     redV.backgroundColor redV.alpha = 0.5;     [self.view addSubview:redV]; UILabel * lbl = [[UILabel alloc] initWithFrame:CGRectMake

    1.2K20发布于 2018-09-13
  • 来自专栏Helloted

    图形

    方法里面画图形 - (void)drawRect:(CGRect)rect{ UIBezierPath *p = [UIBezierPath bezierPathWithOvalInRect:CGRectMake rect{ CGContextRef context = UIGraphicsGetCurrentContext(); CGContextAddEllipseInRect(context, CGRectMake - (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx{ CGContextAddEllipseInRect(ctx, CGRectMake ), NO, 0); CGContextRef con = UIGraphicsGetCurrentContext(); CGContextAddEllipseInRect(con, CGRectMake ; UIGraphicsEndImageContext(); UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake

    1.6K10编辑于 2022-06-07
  • 来自专栏iOS开发~

    iOS_自定义UITabBarController标签视图控制器

    imageNamed:@"icon_home_h"] forState:UIControlStateSelected]; findBtn.tag = 1; findBtn.frame = CGRectMake findBtn; [myView addSubview:findBtn]; UILabel *findLabel = [[UILabel alloc] initWithFrame:CGRectMake ; [myView addSubview:searchBtn]; UILabel *searchLabel = [[UILabel alloc] initWithFrame:CGRectMake iconfont-like-selected"] forState:UIControlStateSelected]; costBtn.tag = 3; costBtn.frame = CGRectMake ); [myView addSubview:costBtn]; UILabel *collectLabel = [[UILabel alloc] initWithFrame:CGRectMake

    88430编辑于 2022-07-20
  • 来自专栏c#开发者

    IOS5开发-控件位置适应屏幕旋转代码

    setAnimationDuration:1.0];         }             [UIView setAnimationDelegate:self];         [viewA setFrame:CGRectMake ;         [viewB setFrame:CGRectMake(?,?,?,?)];         [viewC setFrame:CGRectMake(?,?,?,?)] setAnimationDuration:1.0];         }         [UIView setAnimationDelegate:self];         [viewA setFrame:CGRectMake ;         [viewB setFrame:CGRectMake(?,?,?,?)];         [viewC setFrame:CGRectMake(?,?,?,?)] display, then releases it.// - (IBAction) actionBtnOne{ imageView = [[UIImageView alloc] initWithFrame:CGRectMake

    1.7K110发布于 2018-04-12
  • 来自专栏一“技”之长

    iOS开发CoreGraphics核心图形框架之八——层聚合

    绘制三个圆形 CGContextSetRGBFillColor (myContext, 0, 1, 0, 1); CGContextFillEllipseInRect(myContext, CGRectMake )); CGContextSetRGBFillColor (myContext, 0, 0, 1, 1); CGContextFillEllipseInRect(myContext, CGRectMake )); CGContextSetRGBFillColor (myContext, 1, 0, 0, 1); CGContextFillEllipseInRect(myContext, CGRectMake )); CGContextSetRGBFillColor (myContext, 0, 0, 1, 1); CGContextFillEllipseInRect(myContext, CGRectMake )); CGContextSetRGBFillColor (myContext, 1, 0, 0, 1); CGContextFillEllipseInRect(myContext, CGRectMake

    1K21发布于 2018-08-15
  • 来自专栏娱乐心理测试

    展开动画demo

    ]; _upBtn.transform = CGAffineTransformScale(CGAffineTransformIdentity,1,1); _upBtn.frame = CGRectMake delectBtn.transform = CGAffineTransformScale(CGAffineTransformIdentity,1,1); _delectBtn.frame = CGRectMake ]; _upBtn.transform = CGAffineTransformScale(CGAffineTransformIdentity,1,1); _upBtn.frame = CGRectMake delectBtn.transform = CGAffineTransformScale(CGAffineTransformIdentity,1,1); _delectBtn.frame = CGRectMake

    75330发布于 2018-06-07
  • 来自专栏APP自动化测试

    使用CAShapeLayer绘图

    初始化一个实例对象 CAShapeLayer *circle = [CAShapeLayer layer]; circle.bounds = CGRectMake //设置中心位置 circle.path = \ [UIBezierPath bezierPathWithOvalInRect:CGRectMake 一个圆角正方形 + 一个空心圆 + 里面的圆弧 上代码, 重要方法都有注解 CAShapeLayer *layer = ({ CGRect rect = CGRectMake ]; //创建圆路径 UIBezierPath * circleP = [UIBezierPath bezierPathWithOvalInRect:CGRectMake interP]; CAShapeLayer * layer = [CAShapeLayer layer]; layer.bounds = CGRectMake

    1.6K10发布于 2019-10-15
  • 来自专栏月亮与二进制

    《Motion Design for iOS》(三十七)

    usingSpringWithDamping:0.6 initialSpringVelocity:0 options:0 animations:^{ [arrowView setFrame:CGRectMake usingSpringWithDamping:0.6 initialSpringVelocity:0 options:0 animations:^{ [ministryView setFrame:CGRectMake usingSpringWithDamping:0.6 initialSpringVelocity:0 options:0 animations:^{ [addButton setFrame:CGRectMake usingSpringWithDamping:0.6 initialSpringVelocity:0 options:0 animations:^{ [firstRow setFrame:CGRectMake usingSpringWithDamping:0.6 initialSpringVelocity:0 options:0 animations:^{ [thirdRow setFrame:CGRectMake

    50320发布于 2021-11-23
  • 来自专栏码农的生活

    iOS简易抽屉效果

    _leftView = [[UIView alloc] init]; //把左侧边的view先隐藏 _leftView.frame = CGRectMake(-200, 0, 200, self.view.frame.size.height leftView已全部拉出,则无法再向右 if (_leftView.frame.origin.x >= 0 || Xresult >= 0) { _leftView.frame = CGRectMake leftView已全部收回,则无法再向左 if (_leftView.frame.origin.x <= -200 || Xresult <= -200) { _leftView.frame = CGRectMake [self closeView:YES]; } } } (void)closeView:(BOOL)close { if (close) { [self moveView:CGRectMake (-200, 0, 200, self.view.frame.size.height)]; } else { [self moveView:CGRectMake(0, 0, 200, self.view.frame.size.height

    1.1K10发布于 2021-10-29
  • 来自专栏清墨_iOS分享

    自学Swift之路(二)UITableView自定义和实际利用

    } func createSubViews () { // 背景图标 let bgImageView = UIImageView(frame: CGRectMake = 3 self.view.addSubview(userBgView) let userImgView = UIImageView(frame: CGRectMake "密码") pwdBgView.addSubview(pwdImgView) self.pwdTextF = UITextField(frame: CGRectMake // 登录按钮 let loginBtn = UIButton(type: .Custom) loginBtn.frame = CGRectMake(25, buildLabel = UILabel(frame: CGRectMake(101.5, 20, kWidth-130, 20)) buildLabel?.

    3.4K90发布于 2018-05-07
  • 来自专栏iOS Developer

    仿window阿里旺旺登陆界面,打印机吐纸动画效果---转自Bison的技术博客

    UIImageView alloc]init]; backimageView.image =[UIImage imageNamed:@"1.png"]; backimageView.frame = CGRectMake LBSCREEN_WIDTH-100, 30); [self.view addSubview:backimageView]; backView = [[UIView alloc]initWithFrame:CGRectMake addSubview:backView]; login_btn = [UIButton buttonWithType:UIButtonTypeCustom]; login_btn.frame = CGRectMake login_btn.clipsToBounds = YES; pass_btn = [UIButton buttonWithType:UIButtonTypeCustom]; pass_btn.frame = CGRectMake ].CGColor; pass_btn.clipsToBounds = YES; Name_textfield = [[UITextField alloc]initWithFrame:CGRectMake

    61320发布于 2018-07-06
  • 来自专栏一“技”之长

    iOS开发CoreGraphics核心图形框架之七——图像处理

    CGImageRef orignImage = [UIImage imageNamed:@"image"].CGImage; CGContextDrawImage(contextRef, CGRectMake (0, 0, 320, 200), orignImage); CGImageRef rectImage = CGImageCreateWithImageInRect(orignImage, CGRectMake (300, 400, 800, 400)); CGContextDrawImage(contextRef, CGRectMake(0, 220, 320, 200), rectImage); :@"image2"].CGImage; //设置填充 [[UIColor redColor] setFill]; CGContextFillRect(contextRef, CGRectMake (0, 0, 320, 200), mask); CGContextDrawImage(contextRef, CGRectMake(0, 0, 320, 200), orignImage);

    1.9K10发布于 2018-08-15
  • 来自专栏Rindew的iOS技术分享

    iOS初来乍到,你如何开始第一个封装类?

    { self.leftButton = [UIButton buttonWithType:UIButtonTypeSystem]; self.leftButton.frame = CGRectMake self.rightButton = [UIButton buttonWithType:UIButtonTypeSystem]; self.rightButton.frame = CGRectMake point.x = CGRectGetWidth(self.thumbView.frame); } self.thumbView.frame = CGRectMake if (point.x >= CGRectGetWidth(self.thumbView.frame) / 2.) { self.thumbView.frame = CGRectMake )viewDidLoad { [super viewDidLoad]; YLSwitch *mySwitch = [[YLSwitch alloc] initWithFrame:CGRectMake

    1.7K40发布于 2018-06-14
  • 来自专栏DannyHoo的专栏

    iOS开发中简单的图片浏览器

    imageArr = images; // 装滚动视图的滚动视图 UIScrollView * scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake = CGPointMake(WIDTH * (index-1), 0);   // 偏移量 UILabel * indexLbl = [[UILabel alloc] initWithFrame:CGRectMake for ( int i = 0 ; i < images.count ; i++ ) { UIScrollView *sc = [[UIScrollView alloc] initWithFrame:CGRectMake 1 + i;         [scrollView addSubview:sc]; UIImageView *img = [[UIImageView alloc] initWithFrame:CGRectMake [ImageBrowserView alloc] initWithImageArr:_goodsModel.atlas andTag:tag];     imageBrowser.frame = CGRectMake

    1.4K20发布于 2018-09-13
领券