自定義滾動導航控制項

2021-06-28 11:17:15 字數 1703 閱讀 6697

2015/04/25/更新控制左邊距,水平間距,固定title寬屬性, 增加非相鄰頻道切換不需要動畫方式。

之前囤了不少自定義的控制項,都準備放上來的,但是太懶了...最近發現有需要的時候卻死活找不著了,所以決定開始整理整理,挨個放上來,既幫助了有需要的人也方便了自己...

滾動導航檢視

效果圖:

覺得不錯請點一下五角星

使用方法

新專案記得在vc中

self

.automaticallyadjustsscrollviewinsets=no;

/* tpl 使用方法 */

_scrollshowview = [[tplscrollshowviewalloc] initwithframe:cgrectmake(0,height,screenwidth, screenheight - height)];

_scrollshowview.backgroundcolor = [uicolorwhitecolor];

[self.viewaddsubview:_scrollshowview];

//可以根據網路請求獲得頭標題陣列,根據檢視的type建立不同的vc

//set config

_scrollshowview.titleheight =35;

_scrollshowview.titlearray = [@[@"首頁",@"寶媽攻略",@"排行榜",@"商品預警",@"分類"]mutablecopy];

//引數設定

// _scrollshowview.titlesbackgroundcolor = [uicolor blackcolor];

// _scrollshowview.titlebottomlinecolor = [uicolor redcolor];

// _scrollshowview.titlebottomlineheight = 10;

// _scrollshowview.titlefont = [uifont systemfontofsize:20];

// _scrollshowview.titlenormalcolor = [uicolor greencolor];

// _scrollshowview.titleselectcolor = [uicolor redcolor];

nsmutablearray * vcarray = [[nsmutablearrayalloc] initwithcapacity:0];

for (int i = 0; i < _scrollshowview.titlearray.count; i++)

//設定

_scrollshowview.viewscontrollerarray = vcarray;

/* tpl */

上下滾動文字自定義控制項

public class verticalrollingtextview extends view private void parseattrs context context,attributeset attrs override protected void ondraw canvas can...

自定義 View 迴圈滾動刻度控制項

先看效果圖 enter description here loopscaleview 是乙個自定義的刻度尺風格的選值控制項,從上面的 大家可以看到 loopscaleview 的執行效果.可以設定螢幕內顯示的刻度數,也可以設定每乙個刻度代表的值得大小。onvaluechangelistener 刻度...

自定義控制項 自定義鐘錶

private context mcontext 畫筆 private paint mpaint 控制項的寬 private int mwidth x方向的圓心座標 private int center 鐘錶的半徑 private int mradio 圓環的寬 private int stroke...