標籤:
1.文字框
設定密碼屬性:Secure Text Entry 勾選;
設定文字框帶清除屬性: Clear Button =Is always visible; 預設是不帶清除屬性:Never appears
設定文字框預設帶出文字屬性:Placeholder=使用者自訂輸入;
設定文字框鍵盤使用者輸入完成隱藏代碼:
[self.text resignFirstResponder];//適用於單個文字框輸入完成時隱藏
[self.view endEditing:YES];//適用於全部文字框輸入完成時隱藏;
2.按鈕
設定高亮狀態:State Config =Highlighted(高亮) Default (預設狀態);
設定預設狀態和高亮狀態下設定按鈕背景圖片屬性:Background=使用者自訂圖片名稱,例如 img_01;
3、屬性
HigHlighed Adjusts Image 高亮狀態點擊無的反映
User Interaction Enabled 是否與使用者互動 4、設定狀態列//改變狀態列的文字顏色為白色
- (UIStatusBarStyle)preferredStatusBarStyle
{
return UIStatusBarStyleLightContent;
}
//隱藏狀態列
-(BOOL)prefersStatusBarHidden
{
return YES;
} UIAlertView * alerView = [[UIAlertView alloc] initWithTitle:@"操作提示" message:@"恭喜通關!" delegate:nil cancelButtonTitle:@"確定"otherButtonTitles:@"確定",nil];
//顯示對話方塊
[alerView show];
//設定userview與使用者互動
self.userview.userInteractionEnabled =YES;
//清除所有控制項
[self.userview.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];//給userBtn添加單擊事件 @selector(optiondataClick:)把當前點擊的按鈕傳到事件中 [userBtnaddTarget:self action:@selector(optiondataClick:) forControlEvents:UIControlEventTouchUpInside]; //聲明空的字串變數拼接時使用 NSMutableString* userInput =[NSMutableString string]; //拼接 [userInput appendString:Data]; //延遲0.5秒調用方法
[self performSelector:@selector() withObject:nil afterDelay:0.5];
//把view 中的一個子控制項顯示到最上層
[self.view bringSubviewToFront:self.btnIcon];
ios 學習筆記之控制項屬性