有一些問題讓我頭部調整大小UIViews和繪圖drawRect。目前我正在drawRect中的UIView中執行一些自定義繪圖。現在我想調整框架的大小,但保持內部繪圖不變。使用UISlider我有:調整UIView框架的大小會導致內容調整大小
- (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;
}
框架正在增長,但其內部的內容也隨之擴展。我究竟做錯了什麼?任何指針都會很棒。謝謝
這樣做了,謝謝 – Kex