简体   繁体   English

Android 改变按钮形状

[英]Android Change Shape of Button

I'm trying to design a button for an android application like this:我正在尝试为 android 应用程序设计一个按钮,如下所示:

在此处输入图像描述

The length of the button will be determined based on the size of the text.按钮的长度将根据文本的大小确定。 The text will change during runtime depending on the page the button is displayed on.文本将在运行时根据显示按钮的页面而改变。 Does anyone have an idea on how I can achieve this?有谁知道我如何实现这一目标?

Just use a regular button with 9-patch png image as a background.只需使用带有 9-patch png 图像的常规按钮作为背景。 More about 9-patch can be read here: Draw 9-patch .可以在此处阅读有关 9-patch 的更多信息:绘制 9-patch

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM