ios 學習筆記之控制項屬性

來源:互聯網
上載者:User

標籤:

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 學習筆記之控制項屬性

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.