自定义button

来源:2-24 自定义UIButton(中)

盛益华通

2018-06-26 17:22:08

为什么没有调用button的自定义构造方法就已经实现?

self对象到底代表谁?

self.imageview.contentmode=uiviewcontentmodecenter;是什么意思?

写回答

1回答

imoocLovers

2018-06-26

①MyButton这个类继承UIButton,重写initWithFrame:方法,在这个方法中完成button的初始化设置。

②MyButton这个类中的self表示MyButton类的对象。

③self.imageview.contentmode=uiviewcontentmodecenter;表示图片显示在imageview的正中间,原图大小

0

0 学习 · 1878 问题

查看课程