0
UIButtonTypeSystem沒有在iOS 6中定義在代碼測試中是否爲iOS6定義了UIButtonTypeSystem
如果我把下面的代碼會崩潰應用程序?
if(appSetting.iOSVersion>=7){
photo = [UIButton buttonWithType:UIButtonTypeSystem];
}else{
photo = [UIButton buttonWithType:UIButtonTypeRoundedRect];
}
如何編碼以檢查UIButtonTypeSystem是否定義並防止崩潰?
我嘗試在代碼中使用UIButtonTypeRoundedRect,當它是iOS 7設備時。該圖像未顯示在按鈕中。它顯示藍色按鈕。有些線程推薦使用UIButtonTypeSystem,它的工作原理。在iOS 6中,它會崩潰。 http://stackoverflow.com/questions/18133465/setting-uibutton-image-results-in-blue-button-in-ios-7 – JosephT 2014-09-11 10:19:07