我想在點擊按鈕時從筆尖文件添加視圖作爲我的主視圖的子視圖,但它必須位於框架中(0,108,320,351)。我試過下面的代碼:將從筆尖加載的子視圖添加到框架中
-(IBAction) displayJoinmeetup:(id)sender
{
[meetups removeFromSuperview]; //removing the older view
CGRect myFrame = CGRectMake(0, 108,320,351);
[joinmeetup initWithFrame:myFrame]; //joinmeetup declared in header file as IBoutlet UIView*joinmeetup
[self.view addSubview:joinmeetup];
}
此只顯示黑屏,否則如果我刪除幀子視圖顯示覆蓋了整個屏幕,我怎麼能正確地做到這一點?
謝謝你現在正常工作! – sujith1406 2010-12-20 06:25:01