<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之旅 廣告
                @UISearchBar search = [[UISearchBar?alloc]initWithFrame:CGRectMake(0,44,320,120)]; pragma mark -基本設置 //控件的樣式?默認--0白色,1是黑色風格 /* UIBarStyleDefault? ? ? ? ? = 0, UIBarStyleBlack? ? ? ? ? ? = 1, search.barStyle?=UIBarStyleDefault; /* UISearchBarStyleDefault, // currently UISearchBarStyleProminent UISearchBarStyleProminent,?// used my Mail, Messages and Contacts(provides no default background color or image but will display one if customized as such系統提供的顏色和圖片無效,自定制有效) ?? ? UISearchBarStyleMinimal ? ?// used by Calendar, Notes and Music ?? ? */ ? ? search.searchBarStyle?=UISearchBarStyleDefault; ?? ? ? ??//?控件上面的顯示的文字 ? ? search.text?=@"HMT"; ?? ? ? ??//?顯示在頂部的單行文字,通常作為一個提示行 ? ? search.prompt?=@"DOTA"; ?? ? ? ??//?半透明的提示文字,輸入搜索內容消失 ? ? search.placeholder?=@"請輸入要搜索的詞語"; ?? ? ? ??// bar的顏色(具有漸變效果)搜索欄閃動條和選擇欄邊框,取消按鈕和選擇欄被選中時候都會變成設置的顏色 ? ? search.tintColor?= [UIColor?redColor]; ?? ? ? ??//?除搜索欄框框,就像貼了一張鏤空了搜索欄的顏色貼圖,不影響其他任何設置的顏色 ? ? search.barTintColor?= [UIColor?whiteColor]; ?? ? ? ??//?指定控件是否會有透視效果 ? ? search.translucent?=YES; ?? ? ? ??//?設置在什么的情況下自動大寫 ? ??/* ?? ? UITextAutocapitalizationTypeNone, ? ? ? ? ? ? //除非自己點擊大寫,否則永不大寫 ?? ? UITextAutocapitalizationTypeWords,? ? ? ? ? ? //以單詞來區分,每個單詞首字母大寫 ?? ? UITextAutocapitalizationTypeSentences,? ? ? ? //以句子來區分 ?? ? UITextAutocapitalizationTypeAllCharacters,? ? //所有字母全部大寫 ?? ? */ ? ? search.autocapitalizationType?=UITextAutocapitalizationTypeNone; ?? ? ? ??//?對于文本對象自動校正風格(額,我也不知道有什么用) ? ??/* ?? ? UITextAutocorrectionTypeDefault, ?? ? UITextAutocorrectionTypeNo, ?? ? UITextAutocorrectionTypeYes, ?? ? */ ? ? search.autocorrectionType?=UITextAutocorrectionTypeNo; ?? ? ? ??//?鍵盤的樣式(具體可參考文章UITableView詳解(一)) ? ? search.keyboardType?=UIKeyboardTypeNumberPad; ?? ? #pragma mark -?設置搜索欄右邊按鈕圖標(UISearchBarIcon) ?? ? ? ??//?是否在控件的右端顯示一個書的按鈕 ? ? search.showsBookmarkButton?=YES; ?? ? ? ??//?是否顯示cancel按鈕(靜態) ? ??//search.showsCancelButton?= YES; ? ??//?是否顯示cancel按鈕(帶有動畫效果) ? ? [search?setShowsCancelButton:YES?animated:YES]; ?? ? ? ??//?是否在控件的右端顯示搜索結果按鈕(圖形是一個圓里面放著一個向下的箭頭) ? ? search.showsSearchResultsButton?=YES; ? ??//?搜索結果按鈕是否被選中 ? ? search.showsSearchResultsButton?=YES; ?? ? ? ??//?設置控件的右端顯示搜索結果按鈕處?---?可用圖片替換掉 ? ? [search?setImage:[UIImage?imageNamed:@"qiyi.png"]forSearchBarIcon:UISearchBarIconResultsList?state:UIControlStateNormal]; #pragma mark -?搜索欄下部選擇欄 ?? ? ? ??//?搜索欄下部的選擇欄,數組里面的內容是按鈕的標題 ? ? search.scopeButtonTitles?= [NSArray?arrayWithObjects:@"iOS",@"Android",@"iPhone",nil]; ?? ? ? ??//?進入界面,搜索欄下部的默認選擇欄按鈕的索引(也就是第一出現在哪個選擇欄) ? ? search.selectedScopeButtonIndex?=2; ?? ? ? ??//?控制搜索欄下部的選擇欄是否顯示出來(顯示的話,就要修改search的frame,不顯示的話80就夠了) ? ? search.showsScopeBar?=YES; ?? ? pragma mark -?設置控件圖片 ?? ? ? ??//?設置控件背景圖片 ? ? search.backgroundImage?= [UIImage?imageNamed:@"qiyi.png"]; ?? ? ? ??//?設置搜索欄下部背景圖片 ? ? search.scopeBarBackgroundImage?= [UIImage?imageNamed:@"qiyi.png"]; pragma mark -?協議UISearchBarDelegate (不解釋了,看名字,已經很明顯了) @編輯文本 ?// UISearchBar得到焦點并開始編輯時,執行該方法 - (BOOL)searchBarShouldBeginEditing:(UISearchBar?*)searchBar; ? ? ? ? ??// return NO to not become first responder - (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar{ ? ? ? ? ?// called when text starts editing ? ? ? ? ? [searchBar?setShowsCancelButton:YES?animated:YES]; ? // ?動畫顯示取消按鈕 } - (BOOL)searchBarShouldEndEditing:(UISearchBar?*)searchBar; ? ? ??// return NO to not resign first responder - (void)searchBarTextDidEndEditing:(UISearchBar *)searchBar; ? ? ? ? ? ?// called when text ends editing - (void)searchBar:(UISearchBar?*)searchBar textDidChange:(NSString?*)searchText{ ??// called when text changes (including clear) ? ? ? ? ? ? ? ?? ? ?@ 當搜索內容變化時,執行該方法。很有用,可以實現時實搜索 } - (BOOL)searchBar:(UISearchBar *)searchBar shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)textNS_AVAILABLE_IOS(3_0); ? ? ? ? ? ? ? ??// called before text changes @按鈕點擊 - (void)searchBarSearchButtonClicked:(UISearchBar?*)searchBar; ? ??// called when keyboard search button pressed - (void)searchBarBookmarkButtonClicked:(UISearchBar *)searchBar; ? ? ? ?// called when bookmark button pressed - (void)searchBarCancelButtonClicked:(UISearchBar?*) searchBar{ ? ? ? ? ??// called when cancel button pressed ? ??[searchBar?setShowsCancelButton:NO?animated:NO]; ? ?// 取消按鈕回收 ? ? [searchBar?resignFirstResponder]; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?// 取消第一響應值,鍵盤回收,搜索結束 } - (void)searchBarResultsListButtonClicked:(UISearchBar *)searchBarNS_AVAILABLE_IOS(3_2);// called when search results button pressed - (void)searchBar:(UISearchBar?*)searchBar selectedScopeButtonIndexDidChange:(NSInteger)selectedScopeNS_AVAILABLE_IOS(3_0);
                  <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>

                              哎呀哎呀视频在线观看