Android button 圆角矩形
来源:互联网 发布:python能开发界面吗 编辑:程序博客网 时间:2024/05/17 22:42
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <corners android:bottomLeftRadius="25dp" android:bottomRightRadius="25dp" android:radius="8dp" android:topLeftRadius="25dp" android:topRightRadius="25dp" /> <!-- <gradient android:angle="45" android:endColor="#72cb60" android:startColor="#72cb60" />--> <padding android:bottom="10dp" android:left="10dp" android:right="10dp" android:top="10dp" /> <size android:width="100dp" /> <solid android:color="#999" /> <stroke android:width="2dp" android:color="#dcdcdc" /></shape>
不多说了,自己用就知道了,这里我选择给Button在加一个动画:
@Override public void onClick(View view) { switch (view.getId()){ case R.id.button1: Button1Click(view); break; } } private void Button1Click( final View v) { ObjectAnimator o=ObjectAnimator.ofFloat(v,"rotationY",1.0F,0.0F,1.0f) .setDuration(500); o.start(); o.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator valueAnimator) { float animatedValue = (float) valueAnimator.getAnimatedValue(); v.setAlpha(animatedValue); v.setScaleX(animatedValue); v.setScaleY(animatedValue); } }); }
还是很不错的!
里面挺多属性动画样式,有兴趣的可以看看:
http://download.csdn.net/download/kururunga/9994328
阅读全文
0 0
- Android button 圆角矩形
- Android Button圆角矩形+Selector组合
- 圆角矩形button自绘
- Android笔记(4)TextView/Button/ImageView的圆角矩形/圆形控件
- Android 圆角矩形
- button控件圆角矩形的自绘方法
- android圆角矩形背景
- android圆角矩形进度条
- Android 圆角矩形ImageView
- Android自定义圆角矩形
- Android之圆角矩形
- android绘制圆角矩形
- Android自定义圆角矩形
- Android 圆角的Button
- android制作圆角button
- Android 圆角按钮BUTTON
- android view绘制圆角矩形(转)
- Android酱油笔记之圆角矩形
- aaa
- 浅析Java中的final关键字
- Spring+SpringMVC+MyBatis
- Fold expressions
- Android之文字描边
- Android button 圆角矩形
- redis在linux系统作为服务启动
- sublimText 安装插件方法
- 文章标题
- hibernate QBC criteria.createAlias()返回数据数组问题
- Finding the Radius for an Inserted Circle 笛卡尔定理
- Manthan, Codefest 17 C. Helga Hufflepuff's Cup
- Leetcode-Rotate List
- java对redis的基本操作