IOS第四天 5 建立備份區按鈕和判斷結果

2022-08-09 18:06:21 字數 903 閱讀 2356

建立備份區按鈕和判斷結果

/*

* 建立備選區按鈕

*/- (void)createoptionbuttons:(hmquestion *)question

cgfloat optionw =self.optionsview.bounds.size.width;

cgfloat optionx = (optionw - ktotolcol * kbuttonwidth - (ktotolcol - 1) * kbuttonmargin) * 0.5

;

for (int i = 0; i < question.options.count; i++)

nslog(

@"建立候選按鈕");

}//如果按鈕已經存在,在點選下一題的時候,只需要設定標題即可

int i = 0

;

for (uibutton *btn in

self.optionsview.subviews)

}#pragma mark - 候選按鈕點選方法

/** 候選按鈕點選

*/- (void)optionclick:(uibutton *)button

/** 判斷結果

*/- (void

)judge

else

}if(isfull)

else

}}/*

* 修改答題區按鈕的顏色

*/- (void)setanswerbuttonscolor:(uicolor *)color}//

在答案區找到第乙個文字為空的按鈕

- (uibutton *)firstanswerbutton

}return

nil;

}

IOS第四天 6 答題區按鈕點選和亂序

pragma mark 答題區按鈕點選方法 void answerclick uibutton button uibutton optionbuttonwithtilte nsstring title ishidden bool ishidden return nil 亂序 void randamo...

iOS學習 第四天

1.整數 浮點數如何加入到array中去?nsnumber 2.與nsarray提供的isequaltoarray有什麼區別 3.字串 234 轉為整數 4.實現乙個utility類,提供計算階乘 計算a的b次方 5.在其他,m中使用utility 6.類是否支援多繼承?7.完善parent類實現i...

iOS 第四天之ViewController

簡單記載下今天學的基礎 viewcontroller.m import viewcontroller.h inte ce viewcontroller property nonatomic,strong uitextfield textfield end implementation viewcon...