怎样让外界无法改变自定义view的尺寸大小
生活随笔
收集整理的這篇文章主要介紹了
怎样让外界无法改变自定义view的尺寸大小
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?重寫setFrame和setBounds方法即可。
+ (instancetype)testView {return [[self alloc] init]; }- (void)setFrame:(CGRect)frame {frame.size = CGSizeMake(100, 100);[super setFrame:frame]; }- (void)setBounds:(CGRect)bounds {bounds.size = CGSizeMake(100, 100);[super setBounds:bounds]; }?
轉載于:https://www.cnblogs.com/yintingting/p/4544671.html
總結
以上是生活随笔為你收集整理的怎样让外界无法改变自定义view的尺寸大小的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: nosql-redis学习 数据类型
- 下一篇: [Java5新特性]动态代理