<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                #### AlertView控件 彈出對話框: 修改HelloHaoMengZhu項目代碼, 添加AlertView: ~~~ -(IBAction)testAlert?{?? ?????? ????NSString?*str?=?[[NSString?alloc]?initWithFormat:@"Hello,?%@",txtField.text];?? ?????? ????UIAlertView?*alert?=?[[UIAlertView?alloc]?? ??????????????????????????initWithTitle:@"提示"?message:str?? ??????????????????????????delegate:self?? ??????????????????????????cancelButtonTitle:@"Ok"?? ??????????????????????????otherButtonTitles:nil];?? ?????? ????[str?release];?? ?????? ????[alert?show];?? ????[alert?release];?? ?????? }?? ?? -?(void)alertView:(UIAlertView?*)alertView?didDismissWithButtonIndex:(NSInteger)buttonIndex?{?? ????NSLog(@"%@",@"Ok"?);?? }?? ~~~ ![](https://box.kancloud.cn/2016-01-06_568cf5cb653dd.jpg) #### ActionSheet控件 ActionSheet和AlertView比較相似都是給用戶一個提示信息。? 它是從底部彈出。 它通常用于確認潛在的危險或不能撤消的操作, 如刪除一個數據。 為了使用ActionSheet我們需要在h文件中實現UIActionSheetDelegate協議。? 其中, 我們常常需要實現:actionSheet:didDismissWithButtonIndex: 該方法是ActionSheet消失的時候調用。 #### 修改Hello-.h文件 ~~~ @interface?HelloHaoMengZhuViewController?:?UIViewController?? {?? ????UITextField?*txtField;?? ????UIActivityIndicatorView?*?myActivityView;?? ?????? ????IBOutlet?UIProgressView?*Progress;?? ????NSTimer?*timer;?? }?? ~~~ 在Hello_Controller.h文件中添加協議UIActionSheetDelegate: ~~~ -(IBAction)testActionSheet?{?? ?????? ????NSString?*str?=?[[NSString?alloc]?initWithFormat:@"Hello,?%@",txtField.text];?? ?????? ?????? ????UIActionSheet?*action?=?[[UIActionSheet?alloc]?initWithTitle:@"提示"?? ????????????????????????????????????????????????????????delegate:self?? ???????????????????????????????????????????????cancelButtonTitle:@"取消"?? ??????????????????????????????????????????destructiveButtonTitle:@"確定"?? ???????????????????????????????????????????????otherButtonTitles:nil];?? ????[str?release];?? ????[action?showInView:self.view];?? ????[action?release];?? ?????? }?? ?? -?(void)actionSheet:(UIActionSheet?*)actionSheet?didDismissWithButtonIndex:(NSInteger)buttonIndex?{?? ?????? ????if?(buttonIndex?==?[actionSheet?destructiveButtonIndex])?{?? ????????NSLog(@"%@",@"確定"?);?? ????}?else?if?(buttonIndex?==?[actionSheet?cancelButtonIndex])?{?? ????????NSLog(@"%@",@"取消"?);?? ????}?? }?? ~~~ ![](https://box.kancloud.cn/2016-01-06_568cf5cb87b84.jpg) #### 等待有關控件 對于一些費時的處理, 需要使用一些等待控件消除用戶心里等待的時間。 等待有關的控件有: UIActivityIndicatorView UIProgressView 設計UI: ![](https://box.kancloud.cn/2016-01-06_568cf5cba3bec.jpg) UIActivityIndicatorView的實現 ~~~ -(IBAction)onClickButton2:?(id)sender?{?? ????if?([myActivityView?isAnimating])?{?? ????????[myActivityView?stopAnimating];?? ????}?else?{?? ????????[myActivityView?startAnimating];?? ????}?? }?? ~~~ ![](https://box.kancloud.cn/2016-01-06_568cf5cbc6d85.jpg) UIProgressView的實現 ~~~ -(IBAction)start{?? ????Progress.progress?=?0.0;?? ????timer?=?[NSTimer?? ?????????????scheduledTimerWithTimeInterval:1.0?? ?????????????target:self?? ?????????????selector:@selector(update)?? ?????????????userInfo:nil?repeats:YES];?? }?? ~~~ 代碼說明: NSTimer是可以隱式地啟動一個線程, scheduledTimerWithTimeInterval指定線程要休眠多少時間調用一次,? selector所指定的方法update。 ~~~ -(void)update{?? ????Progress.progress?=?Progress.progress?+?0.1;?? ????if?(Progress.progress?==?1.0)?{?? ????????[timer?invalidate];?? ????????UIAlertView?*alert?=?[[UIAlertView?alloc]?? ??????????????????????????????initWithTitle:@"任務通知"?? ??????????????????????????????message:@"波多野結衣.avi?下載完成!"?? ??????????????????????????????delegate:self?? ??????????????????????????????cancelButtonTitle:@"OK"?? ??????????????????????????????otherButtonTitles:nil];?? ????????[alert?show];?? ????????[alert?release];?? ????}?? }?? ~~~ 代碼說明: UIProgressView控件的progress屬性是0.0~1.0煩范圍。? 0.0時候在開始的位置, 1.0時候是進度到了100%。 ![](https://box.kancloud.cn/2016-01-06_568cf5cbe6213.jpg) ![](https://box.kancloud.cn/2016-01-06_568cf5cc16e17.jpg)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看