机器人 - 按钮样式 [英] android - button style

查看:143
本文介绍了机器人 - 按钮样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

普通按钮看起来像:

现在,请让我知道,我怎样才能使一个简单的按钮一样的附加图像按钮(即键角形状是圆的,也有两个按键之间没有缝隙)

Now, please let me know, How can i make a simple button same as an attached image button (i.e. button corner shape is round and also there is no gap between two buttons)

推荐答案

9补丁将工作在这里很好,但我会尽量避免他们,因为这对我来说很难做到这些:(

9-patch would work fine here, but I try to avoid them since it's hard for me to do them :(

您可以尝试有一个选择和使用形状为每个状态:

You can try having a selector and using a shape for each state:

形状是这样的:

<?xml version="1.0" encoding="UTF-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android" 
     android:shape="rectangle">

    <solid android:color="#AAFFFFFF"/>

    <corners android:bottomRightRadius="7dp"
        android:bottomLeftRadius="7dp" 
        android:topLeftRadius="7dp"
        android:topRightRadius="7dp"/>
</shape>

这篇关于机器人 - 按钮样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆