<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>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ## 一:效果 用UITextField簡單定義一個搜索框? ![](https://box.kancloud.cn/2016-01-20_569f1d98916b2.jpg) ## 二:調用: 調用的代碼,很簡單,直接init就可以,以后加功能自己添加就行了。 ~~~ - (void)viewDidLoad { [super viewDidLoad]; // 創建搜索框 NYSearchBar *searchBar = [[NYSearchBar alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 35)]; searchBar.placeholder = @"貓貓搜索"; // 設置titleView為搜索框 self.navigationItem.titleView = searchBar; } ~~~ ## 三:代碼: NYSearchBar.m文件內容? NYSearchBar.h文件里面沒有東西,? 思路很簡單,就是左邊放一個圖片而已,可以自己添加其他東東。 ~~~ // // NYSearchBar.m // 貓貓微博 // // Created by apple on 15-7-29. // Copyright (c) 2015年 znycat. All rights reserved. // #import "NYSearchBar.h" @implementation NYSearchBar - (instancetype)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { self.font = [UIFont systemFontOfSize:13]; self.background = [UIImage imageWithStretchableName:@"searchbar_textfield_background"]; // 設置左邊的view // initWithImage:默認UIImageView的尺寸跟圖片一樣 UIImageView *imageV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"searchbar_textfield_search_icon"]]; // 為了空出左邊一小塊設置的 imageV.width += 10; imageV.contentMode = UIViewContentModeCenter; self.leftView = imageV; // 一定要設置,想要顯示搜索框左邊的視圖,一定要設置左邊視圖的模式 self.leftViewMode = UITextFieldViewModeAlways; } return self; } @end ~~~ 推薦一個iOS學習帥氣的網站 : code4app 各種各樣的iOS效果和源碼都用,隨下隨用。
                  <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>

                              哎呀哎呀视频在线观看