博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Android圆形按钮示例
阅读量:2506 次
发布时间:2019-05-11

本文共 986 字,大约阅读时间需要 3 分钟。

In this tutorial you will learn how to create a round button in android.

在本教程中,您将学习如何在android中创建圆形按钮。

Shape drawable resource is used to define shape of a view. Below I have shared an example to to make a circle button.

形状可绘制资源用于定义视图的形状。 下面我分享了一个制作圆圈按钮的示例。

Android圆形按钮示例 (Android Round Button Example)

Create a xml file inside res/drawable folder.

res / drawable文件夹中创建一个xml文件。

round_button.xml

round_button.xml

    
    
    

shape: Defines shape of view. It can be rectangle, oval, line and ring. In this case we are using oval shape to make the button circular.

shape:定义视图的形状。 它可以是矩形,椭圆形,线形和环形。 在这种情况下,我们使用椭圆形使按钮变为圆形。

stroke: Defines boundary of shape.

笔触:定义形状的边界。

solid: Defines background color of shape.

实体:定义形状的背景色。

size: Defines size of shape.

size:定义形状的大小。

Now set this xml as background of the button.

现在,将此xml设置为按钮的背景。

The button will look like:

该按钮将如下所示:

Android Round Button Example

You can customize its color and size according to your need.

您可以根据需要自定义其颜色和大小。

翻译自:

转载地址:http://lrggb.baihongyu.com/

你可能感兴趣的文章
js 高亮显示关键字
查看>>
CPU工作原理简图
查看>>
进程互斥于同步
查看>>
小米公布2017二季度手机出货量:环比增长70%
查看>>
IntelliJ Idea 集成svn 和使用[转自网络]
查看>>
VS2013 密钥 – 所有版本
查看>>
缓冲一日
查看>>
apache常用配置文件讲解
查看>>
html设置透明度
查看>>
读写锁详解
查看>>
<taglib>报错
查看>>
sublime 3 注册码 - 亲测可用
查看>>
CENTOS7配置静态IP
查看>>
P3332 [ZJOI2013]K大数查询
查看>>
Linux 批量管理工具
查看>>
# 20175333曹雅坤《Java程序设计》第四周学习总结
查看>>
[转]在Ogre中如何关联textunit 与 cg/hlsl/glsl 语言中的 uniform sampler 关联
查看>>
JavaScript跨域实现
查看>>
模拟Visual Studio中的完全匹配查找
查看>>
fa下载器总结
查看>>