0
對未呈現的視圖進行快照會產生空的快照。當我使用UIActionsheet單擊ios按鈕時,確保您的視圖在屏幕更新後的快照或快照之前至少呈現一次?爲什麼?爲什麼點擊按鈕時顯示錯誤?
- (IBAction)btnAboutUsActions:(UIButton *)sender
{
UIActionSheet * actionSheet = [[UIActionSheet alloc] initWithTitle: nil
delegate:self
cancelButtonTitle: nil
destructiveButtonTitle: nil
otherButtonTitles: @"Achievment",
@"Brown Story", nil];
actionSheet.tag = 100;
[actionSheet showFromRect: sender.frame inView: sender.superview animated: YES];
}
感謝您的建議。但是,我想使用ActionSheet呢?因爲我必須在點擊按鈕時執行多個選項並且多個選項視圖顯示在按鈕下方。 –
嘗試在顯示它之後寫入[[actionSheet.view layoutIfNeeded]]。 – pkc456
我已經試過了! [actionSheet layoutIfNeeded];它不工作! –