【发布时间】:2015-10-19 08:23:17
【问题描述】:
在调整 UIView 大小和在 drawRect 中绘图时遇到了一些问题。目前我正在 drawRect 的 UIView 中执行一些自定义绘图。现在我想调整框架的大小,但保持内部的绘图不变。使用 UISlider 我有:
- (IBAction)changeSize:(id)sender {
//where 20,20 is the original frame position and 72*72 the original size
CGRect newFrame = CGRectMake(20, 20, 72*self.slider2.value, 72*self.slider2.value);
self.square.frame = newFrame;
}
框架在增长,但里面的内容也随之拉长。我究竟做错了什么?对此的任何指示都会很棒。谢谢
【问题讨论】: