Android UI開源組件庫BottomView ,第三方自訂UI控制項

來源:互聯網
上載者:User

 

這裡分享一個Android的非常經典實用而且簡單方便的第三方UI控制項陳列庫:BottomView(小米的米UI也用到了這個)

實現功能:

可以在底部彈出的View裡自訂布局;

可以自訂是否可以觸摸外部消失;

可以自訂事件;

可以自訂外圍背景是否透明;

可以自訂動畫;

如果需要的話,可以強製為頂部View顯示

 

用法:

1、下載BottomView.jar庫檔案,放到Android項目工程裡的libs裡

2、設定BottomView的Theme:

這2個Theme複製粘貼到你的項目的res/values/styles.xml裡即可

 

 
另外如果提示

 

 

 @color/white
這裡的white找不到的話,說明你項目res/values/color.xml沒有建立或者沒有white顏色這個值,只需在res/values/color.xml裡添加

 

 

     #ffffff

這個白色值即可。

 

另外View的動畫Theme可選,建議也複製進去,效果好一些,代碼如下:

 



res/anim/bottomview_anim_enter.xml

 

 

    

res/anim/bottomview_anim_exit.xml

 

 

    

整體為:

 

 

 

2、部分核心使用代碼:

 

BottomView bottomView = new BottomView(this,R.style.BottomViewTheme_Defalut, R.layout.bottom_view);bottomView.setAnimation(R.style.BottomToTopAnim);//設定動畫,可選bottomView.showBottomView(false);

 

如果想擷取這個View的話,調用.getView()方法即可。

之一:(可隨意發揮)


 

不懂的加我QQ 852041173

 

歡迎加入MtAndroid開發人員QQ群:271410559

 

百度網盤備用:

 

BottomView.jar庫檔案:http://pan.baidu.com/s/1mg7eseG

BottomView的Demo:http://pan.baidu.com/s/1hqkRM8s

 

首發地址:http://www.aplesson.com/?p=400

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.