【发布时间】:2015-08-05 17:06:21
【问题描述】:
xml 文件:
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:id="@+id/singleProp"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:visibility="gone">
<ImageView
android:layout_width="200dp"
android:layout_height="200dp"
android:id="@+id/propertyImg"/>
<ListView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/propertyData"
android:layout_below="@id/propertyImg">
</ListView>
</RelativeLayout>
使用上述代码,图像将固定在顶部中心位置。使用 html 中的 CSS 术语,该图像视图的样式是 style="position:fixed",但我想要的是 style="position:relative"。
我希望图片能说明这个想法。 我可以知道我应该如何修改我的代码吗?
【问题讨论】:
-
可以通过Java文件动态放置ImageView。