【发布时间】:2014-11-11 06:49:52
【问题描述】:
我有一个自定义数组适配器,其中每个项目由一个图像视图上的两个文本视图组成(SmartImageView 是第三方图像视图,可以从 url 呈现远程图像):
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.loopj.android.image.SmartImageView
android:id="@+id/backgroundImage"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<RelativeLayout
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:text="Data Model Title"
android:textSize="30sp" />
<TextView
android:id="@+id/details"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/title"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:text="Data Model Details"
android:textSize="15sp" />
</RelativeLayout>
</FrameLayout>
我看到的图像有上下边距,没有文字:
1) 带有文本的 RelativeLayout 应该覆盖图像,因为它是 FrameLayout 的第二个孩子
2) 为什么我的图片上下都有边距?我说我的 imageview 的尺寸与父级匹配,并且没有为其指定任何顶部或底部边距
【问题讨论】:
标签: android android-framelayout