【发布时间】:2017-12-29 10:10:42
【问题描述】:
这是我第一次在这里发布一个 android 问题。如果我做错了什么,请告诉我。
我有一个列表视图,我在我的 android 项目(xamarin,c#)中使用此代码作为我的列表视图项
<FrameLayout xmlns:a="http://schemas.android.com/apk/res/android"
a:layout_width="match_parent"
a:layout_height="wrap_content">
<ImageView
a:layout_width="wrap_content"
a:layout_height="wrap_content"
a:adjustViewBounds="true"
a:id="@+id/imgRecipeView" />
<TextView
a:id="@+id/recipeTitle"
a:layout_width="wrap_content"
a:layout_height="wrap_content"
a:layout_alignParentTop="True" a:layout_below="@id/imgRecipeView" />
</FrameLayout>
我希望这个图像视图具有它自己的全宽和全高。接下来目前我的文本视图显示在图像上。我想在图像之后显示它们(顶部的图像,底部的文本,目前它正在重叠)。
我尝试了 linearlayout 和 relativelayout ,但它没有按我想要的方式工作。
【问题讨论】:
-
LinearLayout的哪些方面不适合你 -
@zcui93 我希望这个图像视图具有全宽作为屏幕。
-
你的布局的父宽度是多少?全宽?
-
是的,可用屏幕的宽度(未应用任何内容)
标签: c# android android-layout listview xamarin