2011-09-28 38 views
0

當我畫在ipad上的橫向模式的UIView,它給出錯誤的寬度和高度不對,我剛纔提到如下CGRectMake在橫向模式下無法正常工作?

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    return (interfaceOrientation==UIInterfaceOrientationLandscapeRight); 
} 

rightView.view.frame = CGRectMake(598, 700, 60, 171); 

但寬度是非常高的,高度很低...任何幫助嗎?

回答

0

當在橫向模式下,當框架處於其父視圖的座標系統和所述父視圖具有CGAffineTransform施加(以應用接口取向),具有和高度被反轉。

this other question也有相關問題

+0

憑什麼我給幀分配? CGRectMake(x,y,hieght,width)..我是對嗎? – nameless

+0

是的,如果真的涉及到的事實,你的接口方向以橫向旋轉,即應該做的伎倆:) – AliSoftware

0

你可以通過設置框狀的交易。它會給你一個需要的結果。

CGRectMake(self.view.size.width-426 ,self.view.size.height-100 , self.view.size.width-366, self.view.size.height-497); 
0

只寫線以下 rightView.view.frame = CGRectMake(598,700,171,60);

相關問題