iOS制作QQ聊天小水滴

作者: 洲洲哥 | 来源:发表于2016-05-21 17:16 被阅读96次

    本文首发地址

    这里写图片描述
    UIImage * CharacterBtnImage = [UIImage imageNamed:@"whiteBack"];
        CharacterBtnImage = [CharacterBtnImage stretchableImageWithLeftCapWidth:CharacterBtnImage.size.width * 0.5 topCapHeight:CharacterBtnImage.size.height * 0.5];
       
        UIButton * btn1 = [UIButton buttonWithType:UIButtonTypeCustom];
        btn1.frame = CGRectMake(10, 100, 280, 50);
        [btn1 setTitle:@"登陆" forState:UIControlStateNormal];
        [btn1 setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
        [self.view addSubview:btn1];
        // 这里一定要用 setBackgroundImage
        [btn1 setBackgroundImage:CharacterBtnImage forState:UIControlStateNormal];
    

    如有问题可添加我的QQ:1290925041
    还可添加QQ群:234812704(洲洲哥学院)
    欢迎各位一块学习,提高逼格!
    也可以添加洲洲哥的微信公众号

    相关文章

      网友评论

        本文标题:iOS制作QQ聊天小水滴

        本文链接:https://www.haomeiwen.com/subject/euhorttx.html