Create a Button with an Image and Text [Android]
来源:互联网 发布:js canvas动画 编辑:程序博客网 时间:2024/05/18 00:18
The Android SDK docs aren’t very helpful. Period. More specifically, they aren’t clear on how to create a button with both an image and text. Allow me to help.
Place the following in your layout XML file, replacing [image] with your image:
<Button android:id="@+id/groups_button_bg" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="Groups" android:drawableTop="@drawable/[image]" />
Using android:drawableTop="@drawable/..."
, we’re able to place an imageabove the button text. The following options are available for placing the image in different positions relative to the button text:
android:drawableLeftandroid:drawableRightandroid:drawableBottomandroid:drawableTop
In addition, android:drawablePadding
can be used to specify the amount of padding between the image and button text.
- Create a Button with an Image and Text [Android]
- Generate an Image with a Random Number
- Create Swing Image Button
- get an image file with XMLHttpRequest and encode with base64
- 支持PGN 图片的image and text button
- Create Image with Reflection
- HOW TO: Create an Assembly with a Strong Name
- Cannot create an NSPersistentStoreCoordinator with a nil model 问题解决
- How To Create a Simple Magazine App with Core Text
- How To Create a Simple Magazine App with Core Text
- how-to-create-a-simple-magazine-app-with-core-text
- An Image Viewer with Lossless Rotation, EXIF and Other Goodies
- An example editor with table and image support
- NavigationBar ( with an image )
- How to Create a Slick and Clean Button in Photoshop
- Create a Base Image
- Create a base image
- What is a texture and what is an Image
- 多屏幕设计——实现适应性的UI布局
- MSSQL SERVER中出现服务器MSDTC不可用的解决方法
- 读写Excel文件(1)
- ls 输出结果的逐条解释
- 用C#中的params关键字实现方法形参个数可变
- Create a Button with an Image and Text [Android]
- camcorder effect support
- 当前标识没有对“C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files”的写访问权限。
- oracle期末(三)
- java 运行环境classes目录
- http协议学习和总结系列
- Android Graphic : apk and Skia/OpenGL|ES
- linux设备驱动开发学习笔记一
- MSSQL 中存储过程跨服务器调用存储过程的时候,编辑Link server 的RPC的时候报错