怎样让外界无法改变自定义view的尺寸大小
生活随笔
收集整理的這篇文章主要介紹了
怎样让外界无法改变自定义view的尺寸大小
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
?重寫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]; }?
轉(zhuǎn)載于:https://www.cnblogs.com/yintingting/p/4544671.html
總結(jié)
以上是生活随笔為你收集整理的怎样让外界无法改变自定义view的尺寸大小的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: nosql-redis学习 数据类型
- 下一篇: Jquery Mobile 百度地图 D