亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

Android自定義view實(shí)現(xiàn)拖拽選擇按鈕

 更新時(shí)間:2020年05月29日 09:02:30   作者:葉角  
這篇文章主要為大家詳細(xì)介紹了Android自定義view實(shí)現(xiàn)拖拽選擇按鈕,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了Android實(shí)現(xiàn)拖拽選擇按鈕的具體代碼,供大家參考,具體內(nèi)容如下

github地址:https://github.com/xuezj/DragChooseDemo

DragChooseDemo

效果圖

Attributes屬性(布局文件中的自定義屬性)

半徑、文字大小、按鈕個(gè)數(shù)注意配合使用,以達(dá)到最佳效果

方法

使用

布局文件中的使用

<com.xuezj.dragchooselibrary.view.DragChooseView
  android:id="@+id/my_view"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  choose:background_color="#efeff4"
  choose:border_color="#ffcfcfd3"
  choose:enabled="@mipmap/sliderwifion"
  choose:focused="@mipmap/sliderwifioff"
  choose:text_size="12sp"
  choose:counts="5"
  choose:radius="20" />

代碼中調(diào)用

dragChooseView =(DragChooseView)findViewById(R.id.my_view);

dragChooseView.setTextData("自定義","單選","雙選","全選","sss","ddd");
dragChooseView.addOnChooseItemListener(new DragChooseView.OnChooseItemListener() {
  @Override
  public void chooseItem(int index, String text) {
    Toast.makeText(MainActivity.this, text, Toast.LENGTH_SHORT).show();
  }
});

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論