簡體   English   中英

iOS確定UIAlertView的大小

[英]iOS determine UIAlertView size

我想在顯示之前和設置之后確定UIAlertView的寬度。 我需要將UIImageView放入其中,並將其寬度調整為UIAlertView的寬度。 有什么辦法嗎?

您可以使用此ios-custom-alertview https://github.com/wimagguc/ios-custom-alertview

嘗試修改UIAlertView的高度/寬度或向其中添加UIImageView並不是一個好主意,因為這可能會導致您的應用程序被App Store拒絕。 但是, ios-custom-alertview是一個不錯的選擇。

示例代碼為:

CustomIOS7AlertView *alertView = [[CustomIOS7AlertView alloc] init];
[alertView setContainerView:yourSubView];
[alertView setButtonTitles:[NSMutableArray arrayWithObjects:@"Close", nil]];
[alertView show];

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM