简体   繁体   English

Android中的设计,形状

[英]Design in Android, Shapes

I wounder how its possible to make a shape like the example, with round corners and padding from the screen borders, and also put text inside, how is this possible? 我为如何制作一个像示例一样的形状(具有圆角和从屏幕边框填充的边框)以及在其中放置文本的方法,这怎么可能? 替代文字

You can either use image buttons that contain image background with eg rounded corners or draw your own shapes, Android Shapes . 您可以使用包含带有圆角等图像背景的图像按钮,也可以绘制自己的形状Android Shapes

Using ImageButton you can define hover, focus and default state of a button and appy a background image to each state. 使用ImageButton可以定义按钮的悬停,焦点和默认状态,并将背景图像应用于每种状态。

Here is a small code example with source, tutorial . 这是一个带有源代码tutorial的小代码示例。

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

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