100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > android自定义漂亮按钮样式 Android开发之漂亮Button样式

android自定义漂亮按钮样式 Android开发之漂亮Button样式

时间:2018-10-01 00:41:06

相关推荐

android自定义漂亮按钮样式 Android开发之漂亮Button样式

开发中各种样式的Button,其实这些样式所有的View都可以共用的,可能对于你改变的只有颜色

所有的都是用代码实现

150CC48D90067F05BFAC966F4EE3E21D.jpg

边框样式,给你的View加上边框

android:layout_width="0dip"

android:layout_height="match_parent"

android:layout_margin="5dip"

android:layout_weight="1"

android:background="@drawable/border_line_while"

android:gravity="center"

android:text="边框样式"

/>

边框样式border_line_while.xml

android:useLevel="false"

>

android:right="1dip"

android:bottom="1dip"/>

android:color="@color/theme_red"

/>

android:height="15dip"

/>

圆角Button

android:layout_width="0dip"

android:layout_height="match_parent"

android:layout_margin="5dip"

android:layout_weight="1"

android:background="@drawable/btn_bg_red"

android:gravity="center"

android:text="圆角Button"

/>

圆角样式btn_bg_red.xml

android:topRightRadius="10dip"

android:bottomRightRadius="10dip"

android:bottomLeftRadius="10dip" />

点底色的圆角Button,其实综合上面的就可以自己写

android:layout_width="0dip"

android:layout_height="match_parent"

android:layout_margin="5dip"

android:layout_weight="1"

android:background="@drawable/check_border"

android:gravity="center"

android:text="带边框颜色的Button"

/>

点底色的圆角Button样式check_border.xml

带点击圆角状态的Button,依赖样式文件

android:layout_width="0dip"

android:layout_height="match_parent"

android:layout_margin="5dip"

android:layout_weight="1"

android:background="@drawable/btn_nor_down"

android:gravity="center"

android:text="带点击状态的Button"

/>

带点击圆角状态的Button样式btn_nor_down.xml

带点击状态的Button,这个不依赖圆角样式

android:layout_width="0dip"

android:layout_height="match_parent"

android:layout_margin="5dip"

android:layout_weight="1"

android:background="@drawable/btn_bottom_confirm_bg"

android:gravity="center"

android:text="带点击状态的Button"

/>

带点击圆角状态的Button样式btn_bottom_confirm_bg.xml

android:color="#cfcfd2"/>

android:color="#cfcfd2"/>

原形数字提醒

android:layout_width="50dip"

android:layout_height="50dip"

android:layout_marginLeft="20dip"

android:background="@drawable/hint_superscript_red"

android:gravity="center"

android:text="数字提醒"

/>

原形数字提醒样式hint_superscript_red.xml

android:shape="oval"

android:useLevel="false">

android:top="1dp"

android:right="1dp"

android:bottom="1dp"

/>

android:color="@color/theme_red"

/>

android:height="15dp"

/>

请求网络数据等待框

android:layout_width="50dip"

android:layout_height="50dip"

android:layout_marginLeft="20dp"

android:indeterminate="true"

android:indeterminateDrawable="@drawable/progresstyle"

android:indeterminateTintMode="src_in"/>

请求网络数据等待框样式progresstyle.xml

xmlns:android="/apk/res/android"

android:fromDegrees="0"

android:pivotX="50%"

android:pivotY="50%"

android:toDegrees="1080.0" >

android:innerRadiusRatio="3"

android:shape="ring"

android:thicknessRatio="8"

android:useLevel="false" >

android:centerY="0.50"

android:endColor="@color/theme_red"

android:startColor="@color/white"

android:type="sweep"

android:useLevel="false" />

进度条

android:id="@+id/my_progress"

style="?android:attr/progressBarStyleHorizontal"

android:layout_width="match_parent"

android:layout_height="30dp"

android:layout_marginLeft="20dp"

android:max="10"

android:progress="3"

android:progressDrawable="@drawable/progressbar_color"/>

进度条样式progressbar_color.xml

android:angle="90.0"

android:centerColor="#ac6079"

android:centerY="0.45"

android:endColor="#6c213a"

android:startColor="#FF51AAE6" />

底部线条EditText

android:text="底部线条EditText"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:background="@drawable/edit_for_line_bg"

/>

底部线条EditText样式edit_for_line_bg.xml

android:insetBottom="@dimen/abc_edit_text_inset_bottom_material">

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。