最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

IOS UITableView和NavigationBar的常用設(shè)置詳解

 更新時(shí)間:2017年04月11日 11:46:32   投稿:lqh  
這篇文章主要介紹了IOS UITableView和NavigationBar的常用設(shè)置詳解的相關(guān)資料,需要的朋友可以參考下

IOS UITableView和NavigationBar的常用設(shè)置詳解

TableView:

1.tableview常用基本設(shè)置

// 清除父類UIEdgeInsets 
self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 0,0); 
//禁止?jié)L動(dòng) 
self.tableView.scrollEnabled = NO; 
// tableview頭部視圖設(shè)置 
self.tableView.tableHeaderView =一個(gè)UIView; 
//tableview尾部視圖設(shè)置,這樣用一個(gè)不占空間的UIView初始化可以清除尾部多余空格 
self.tableView.tableFooterView = [[UIView alloc]initWithFrame:CGRectZero]; 
//表格背景色 
self.tableView.backgroundColor = [UIColorgrayColor]; 
//取消垂直滾動(dòng)條 
self.tableView.showsVerticalScrollIndicator=NO; 
//設(shè)置表格背景圖片 
UIView *bgView= [[UIView alloc]initWithFrame:CGRectMake(0,20,SLApplicationW,SLApplicationH)]; 
UIImageView *bgImageView= [[UIImageView alloc]initWithFrame:CGRectMake(0,0,SLApplicationW,SLApplicationH)]; 
  [bgImageView setImage:[UIImageimageNamed:@"tree"]]; 
  [bgView addSubview:bgImageView]; 
self.tableView.backgroundView= bgView; 

2.cell常用基本設(shè)置

//表格附件樣式,指示箭頭 
  
  cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator; 
//禁止點(diǎn)擊變色 
  
  cell.selectionStyle=UITableViewCellSelectionStyleNone; 

3.cell分割線左側(cè)空白清除     

//分割線清偏移 
  if ([cell respondsToSelector:@selector(setSeparatorInset:)]) { 
    [cellsetSeparatorInset:UIEdgeInsetsZero]; 
  } 
//分割線清邊界(沒(méi)啥變化) 
  if ([cell respondsToSelector:@selector(setLayoutMargins:)]) { 
    [cellsetLayoutMargins:UIEdgeInsetsZero]; 
  } 

//清除父邊界 
  if ([cell respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]){ 
    [cellsetPreservesSuperviewLayoutMargins:NO]; 
  
  } 

NavigationBar導(dǎo)航欄:

1.常用基本設(shè)置

self.title =@"標(biāo)題"; 
// 導(dǎo)航欄顏色 
self.navigationBar.barTintColor=[UIColor grayColor]; 
// 導(dǎo)航欄文字顏色 
self.navigationBar.tintColor=[UIColor whiteColor]; 
// 導(dǎo)航欄標(biāo)題顏色 
NSMutableDictionary*textAttrs= [NSMutableDictionary dictionary]; 
 textAttrs[NSForegroundColorAttributeName] =[UIColor whiteColor]; 
self.navigationBarsetTitleTextAttributes:textAttrs]; 
  
//導(dǎo)航欄按鈕1 
UIBarButtonItem*button1= [[UIBarButtonItem alloc] 
             initWithBarButtonSystemItem:UIBarButtonSystemItemAddtarget:selfaction:@selector(function1)]; 
//導(dǎo)航欄按鈕2 
UIBarButtonItem*button2= [[UIBarButtonItem alloc] 
              initWithBarButtonSystemItem:UIBarButtonSystemItemSearchtarget:selfaction:@selector(function2)]; 
//將按鈕添加到導(dǎo)航欄右側(cè)(可以添加多個(gè)) 
  
self.navigationItem.rightBarButtonItems=@[button1, button2]; 

2.系統(tǒng)自帶按鈕

枚舉定義及樣式解釋如下:

typedef NS_ENUM(NSInteger, UIBarButtonSystemItem) { 
  UIBarButtonSystemItemDone,   //Done英文字符 
  UIBarButtonSystemItemCancel,  //Cancel 
  UIBarButtonSystemItemEdit,   //Edit 
  UIBarButtonSystemItemSave,   //Save  
  UIBarButtonSystemItemAdd,    //圖標(biāo)1(加號(hào)圖標(biāo)➕) 
  UIBarButtonSystemItemFlexibleSpace, //?空白 
  UIBarButtonSystemItemFixedSpace,   //?空白 
  UIBarButtonSystemItemCompose,    //圖標(biāo)2(寫字板上一支筆寫字的圖標(biāo)) 
  UIBarButtonSystemItemReply,     //圖標(biāo)3 
  UIBarButtonSystemItemAction,     //圖標(biāo)4 
  UIBarButtonSystemItemOrganize,    //圖標(biāo)5 
  UIBarButtonSystemItemBookmarks,   //<span style="font-family: Menlo;">圖標(biāo)6</span> 
  UIBarButtonSystemItemSearch,     //<span style="font-family: Menlo;">圖標(biāo)7</span> 
  UIBarButtonSystemItemRefresh,    //<span style="font-family: Menlo;">圖標(biāo)8</span> 
  UIBarButtonSystemItemStop,      //圖標(biāo)9 
  UIBarButtonSystemItemCamera,     //圖標(biāo)10 
  UIBarButtonSystemItemTrash,     //圖標(biāo)11 
  UIBarButtonSystemItemPlay,      //圖標(biāo)12 
  UIBarButtonSystemItemPause,     //圖標(biāo)13 
  UIBarButtonSystemItemRewind,     //圖標(biāo)14 
  UIBarButtonSystemItemFastForward,  //圖標(biāo)15 
  UIBarButtonSystemItemUndo NS_ENUM_AVAILABLE_IOS(3_0),    //Redo 
  UIBarButtonSystemItemRedo NS_ENUM_AVAILABLE_IOS(3_0),    //Undo 
  UIBarButtonSystemItemPageCurl NS_ENUM_AVAILABLE_IOS(4_0),  //?空白 
}; 

感謝閱讀,希望能幫助到大家,謝謝大家對(duì)本站的支持!

相關(guān)文章

  • 基于iOS實(shí)現(xiàn)圖片折疊效果

    基于iOS實(shí)現(xiàn)圖片折疊效果

    這篇文章主要為大家詳細(xì)介紹了基于iOS實(shí)現(xiàn)圖片折疊效果,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2017-07-07
  • iOS布局渲染之UIView方法的調(diào)用時(shí)機(jī)詳解

    iOS布局渲染之UIView方法的調(diào)用時(shí)機(jī)詳解

    在你剛開(kāi)始開(kāi)發(fā) iOS 應(yīng)用時(shí),最難避免或者是調(diào)試的就是和布局相關(guān)的問(wèn)題,下面這篇文章主要給大家介紹了關(guān)于iOS布局渲染之UIView方法調(diào)用時(shí)機(jī)的相關(guān)資料,文中通過(guò)示例代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2018-07-07
  • IOS中UIWebView、WKWebView之JS交互

    IOS中UIWebView、WKWebView之JS交互

    本篇文章主要介紹了IOS中UIWebView、WKWebView之JS交互,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2017-06-06
  • 談?wù)刬OS中的幾種鎖

    談?wù)刬OS中的幾種鎖

    這篇文章主要介紹了談?wù)刬OS中的幾種鎖,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下。
    2016-11-11
  • iOS開(kāi)發(fā)一個(gè)好看的ActionSheet

    iOS開(kāi)發(fā)一個(gè)好看的ActionSheet

    本篇文章通過(guò)代碼分享和圖文形式教給大家用IOS寫一個(gè)好看的ActionSheet過(guò)程以及注意事項(xiàng),需要的朋友參考下吧。
    2018-01-01
  • 怎么防止ios系統(tǒng)被抓包?防止ios系統(tǒng)被抓包的方法

    怎么防止ios系統(tǒng)被抓包?防止ios系統(tǒng)被抓包的方法

    怎么防止ios系統(tǒng)被抓包?下面小編就為大家分享一篇防止ios系統(tǒng)被抓包的方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧
    2017-12-12
  • iOS 用Swipe手勢(shì)和動(dòng)畫實(shí)現(xiàn)循環(huán)播放圖片示例

    iOS 用Swipe手勢(shì)和動(dòng)畫實(shí)現(xiàn)循環(huán)播放圖片示例

    本篇文章主要介紹了iOS 用Swipe手勢(shì)和動(dòng)畫實(shí)現(xiàn)循環(huán)播放圖片示例,非常具有實(shí)用價(jià)值,需要的朋友可以參考下。
    2017-03-03
  • iOS關(guān)聯(lián)對(duì)象示例詳解

    iOS關(guān)聯(lián)對(duì)象示例詳解

    這篇文章主要給大家介紹了關(guān)于iOS關(guān)聯(lián)對(duì)象的相關(guān)資料,文中通過(guò)示例代碼結(jié)束的非常詳細(xì),對(duì)大家學(xué)習(xí)或者使用iOS具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2018-12-12
  • 安裝win10+黑蘋果雙系統(tǒng)零基礎(chǔ)教程(圖文)

    安裝win10+黑蘋果雙系統(tǒng)零基礎(chǔ)教程(圖文)

    這篇文章主要介紹了安裝win10+黑蘋果雙系統(tǒng)零基礎(chǔ)教程(圖文),小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2020-01-01
  • 詳解iOS 實(shí)現(xiàn)一對(duì)多代理方案

    詳解iOS 實(shí)現(xiàn)一對(duì)多代理方案

    本文主要介紹了iOS 實(shí)現(xiàn)一對(duì)多代理方案,文中通過(guò)示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2022-01-01

最新評(píng)論

东海县| 南陵县| 郓城县| 隆尧县| 怀宁县| 固镇县| 吉林省| 家居| 高雄县| 华亭县| 古交市| 两当县| 小金县| 永川市| 德清县| 疏勒县| 莱芜市| 图木舒克市| 长丰县| 诸暨市| 蓬安县| 新巴尔虎右旗| 齐河县| 新源县| 梁山县| 龙胜| 平舆县| 黑龙江省| 旬阳县| 开封县| 呈贡县| 宁安市| 大邑县| 延川县| 双鸭山市| 尖扎县| 宁国市| 竹溪县| 墨脱县| 营口市| 东辽县|