关于ShineButton的开源框架的使用

来源:互联网 发布:新浪短链接 java 编辑:程序博客网 时间:2024/06/06 03:02
  • 首先需要导入这个库,在此感谢作者
    https://github.com/ChadCSong/ShineButton

  • 这是图片效果

https://github.com/ChadCSong/ShineButton/blob/master/demo_small.gif

  • 利用这个肯定是要放到listview或者GrideView中的!
  • 首先自己开源先试一下这个控件
  • 我这里就是简单的使用了下,就是用了该作者的属性

  • 在listview中的adapter使用,需要在item的根布局中,设置事件属性
    • android:descendantFocusability=”blocksDescendants” 这个不多说的属性…
    • 然后在adapter中初始化控件,
ShineButton sh_btn1 = (ShineButton) view.findViewById(R.id.sh_btn1);            ShineButton sh_btn2 = (ShineButton) view.findViewById(R.id.sh_btn2);          //  下面的这2句话必须要添加上!否则没有点击事件!!!            sh_btn1.init(MainActivity.this);            sh_btn2.init(MainActivity.this);// 然后就是点击事件的处理sh_btn1.setOnClickListener(...)sh_btn2.setOnClickListener(...

  • 在来就是介绍里面一些属性的简单使用
 app:enable_flashing="true"   // true 表示按下是闪光的效果 ,false表示正常的效果  app:siShape="@raw/ic_action_thumb_up"  //需要将图片放到raw文件下,有的图片放里面可能会使图片变模糊,所以要搞好一点的图片 :)  app:btn_fill_color="#FF6666" // 表示按下后,将图片全部填充成红色

  • 应用下载地址 [http://download.csdn.net/detail/buttonxin/9618369] (http://download.csdn.net/detail/buttonxin/9618369) 里面要把配置文件中的activity切换成MainActivity!!! 嘿嘿
0 0
原创粉丝点击