<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape>
<gradient android:startColor="@color/pres1"
android:endColor="@color/pres2" android:angle="270" />
<stroke android:width="5dp" android:color="@color/stro3" />
<corners android:radius="5dp" />
<padding android:left="10dp" android:top="20dp"
android:right="10dp" android:bottom="20dp" />
</shape>
</item>
<item android:state_focused="true">
<shape>
<gradient android:endColor="@color/focu1"
android:startColor="@color/focu2" android:angle="270" />
<stroke android:width="5dp" android:color="@color/stro2" />
<corners android:radius="5dp" />
<padding android:left="10dp" android:top="20dp"
android:right="10dp" android:bottom="20dp" />
</shape>
</item>
<item>
<shape>
<gradient android:endColor="@color/norm1"
android:startColor="@color/norm2" android:angle="270" />
<corners android:radius="5dp" />
<padding android:left="10dp" android:top="20dp"
android:right="10dp" android:bottom="20dp" />
</shape>
</item>
</selector>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:background="@color/all_white">
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="@string/hello"
android:textColor="@color/all_red" />
<Button android:id="@+id/mq_categories" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="Browse Quiz Categories"
android:background="@drawable/custom_button" />
<Button android:id="@+id/mq_random" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="Enter Random Quiz"
android:background="@drawable/custom_button" />
</LinearLayout>
你会发现上面的有点别扭 注意修改
<Button android:id="@+id/mq_categories"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Browse Quiz Categories"
android:background="@drawable/custom_button"
android:layout_marginBottom="5dp"/>
分享到:
相关推荐
winform界面,圆角button
Glide加载圆形图片和自定义圆角图片,可自己设置圆角大小,可以对指定的角进行加载圆角,自定义圆角大小
c#自定义圆角panel,可设置圆角的弧度,可设置图片,并且有单击事件,自己可以再次修改源码。文件中已生成dll
自定义的button样式,圆角按钮,圆角button
自定义圆角Dialog自定义圆角Dialog自定义圆角Dialog自定义圆角Dialog自定义圆角Dialog自定义圆角Dialog自定义圆角Dialog自定义圆角Dialog自定义圆角Dialog
主要介绍了android 自定义圆角button(自定义View Demo),本文给大家介绍的非常详细,具有一定的参考借鉴价值,需要的朋友可以参考下
自定义圆角图片Demo,自定义圆角ImageView以及锯齿的处理
button_left:左下角为圆角设为true,反之false button_right:右下角为圆角设为true,反之false angle_width:控制圆角大小 angle_height:控制圆角大小 3.以上属性使用方法请看代码中的xml文件,使用简便。
RCImageView 自定义圆角ImageView,带边框效果
很好用的一款自定义android自定义FrameLayout布局Demo,可延伸到自定义View,有需要的小伙伴可以下载试下!
自定义圆角动画按钮 2011.10.16
这是一个自定义圆角的NetworkImageView,解决了使用Volley工具时,需要设置圆形头像的问题
该alertDialog 解决了自定义过程中容易出现边角黑边无法去除等问题,代码简介易懂,类似IOS dialog风格.zip
炫酷的Unity3d UI 自定义圆角面板 插件 Unity UI 圆角面板 - 这是一个简单而实用的Unity资产,可在Unity中创建圆角面板。使用此资源,您可以轻松创建许多形式的Unity ui按钮图片等面板,赶快试试吧! 优点: - ...
RoundAngleImageview 自定义圆角图片
Android自定义圆角View,支持xml设置圆角半径和背景,支持自动适配大小
android自定义圆角imageView
Unity用户自定义圆角头像
android RoundAngleImageView 自定义圆角图片 通过自定义View方法。利用PorterDuffXfermode 知识点,实现圆角图片。