目前看来有三种方法可以实现

1. framelayout, a framelayout is used to stack a TextView on top of an ImageView

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="fill_parent"    android:layout_height="fill_parent">    <ImageView          android:layout_width="fill_parent"         android:layout_height="fill_parent"             android:scaleType="center"        android:src="@drawable/golden_gate" />        <TextView        android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_marginBottom="20dip"        android:layout_gravity="center_horizontal|bottom"        android:padding="12dip"                android:background="#AA000000"        android:textColor="#ffffffff"                android:text="Golden Gate" /></FrameLayout>

2. TextView on Canvas。 和framelayout不同,Canvas不是继承自ViewGroup,它不可以添加child views,所以你需要使用drawBitmap和drawText方法去实现

3. 使用merge tag,方法大致和framelayout一样

<?xml version="1.0" encoding="utf-8"?><!--<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:orientation="vertical"    android:layout_width="fill_parent"    android:layout_height="fill_parent"    >--><merge xmlns:android="http://schemas.android.com/apk/res/android">    <ImageView          android:layout_width="fill_parent"         android:layout_height="fill_parent"             android:scaleType="center"        android:src="@drawable/mini" />        <TextView        android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_gravity="center"        android:padding="12dip"        android:textSize="20sp"        android:textStyle="bold"        android:textColor="#ffff0000"                android:text="Mini-Countryman" /></merge><!--</LinearLayout>-->

具体与framelayout区别参考 http://developer.android.com/resources/articles/layout-tricks-merge.html

更多相关文章

  1. switchpreference属性
  2. android - AsyncTask 的使用
  3. android屏幕自适应4方法案例整合
  4. android开发架构设计学习
  5. Android的快速开发框架afinal
  6. Android动画效果
  7. android应用安全——通信安全(android https)
  8. Android(安卓)中文 API (93) —— BaseExpandableListAdapter
  9. Android:控件GridView的使用

随机推荐

  1. 利用maven对android项目dubug
  2. Android使用MediaRecorder实现录音功能相
  3. Android(安卓)Fragment生命周期深入探究
  4. Android都支持哪些Java特性
  5. android 4.04的应用程序启动过程及与Zygo
  6. Android 端 博客园闪存——alpha版
  7. android LruCache设置缓存的使用
  8. android 简历 android 3年 上海.doc
  9. Java进制转换
  10. Android图片加载神器之Fresco,基于各种使