0 0

请教一个关于imageView设置说明性文字的问题。5

项目需求要做一个抽屉效果的菜单,现在抽屉效果实现了,但是个人觉得有点不够好,想请教一下
如何在这8张小图片下面添加一些说明性文字。这个布局使用的是ImageView。
 


问题补充:我想要的效果是,第一张图片下面说明文字是pic1 ,第二张是pic2。
本人刚开始接触安卓开发,希望能说的详细点。
2014年7月12日 11:44
  • 大小: 830.2 KB

1个答案 按时间排序 按投票排序

0 0

采纳的答案

套在一个framelayout或者relativelayout里
例子:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <ImageView
        android:id="@+id/img"
        android:layout_width="fill_parent"
        android:layout_height="250dp"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:scaleType="fitXY"
        android:src="@drawable/ic_launcher" />

    <TextView
        android:id="@+id/desc_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        android:layout_centerHorizontal="true" />

</RelativeLayout>

文字怎么显示自己调整下属性

2014年7月12日 13:40

相关推荐

Global site tag (gtag.js) - Google Analytics