【发布时间】:2018-06-09 15:08:08
【问题描述】:
我正在尝试创建一个 android 布局,其中我有一个 imageview 以及一个两列 textview 直接位于它的右侧,所有这些都在一个滚动视图中。
像用户头像和基本信息布局一样思考。
我已经创建了一个我想要实现的线框,不幸的是我似乎无法让 imageview - textview - textview 的布局正确。
我所做的所有其他事情。
编辑 这是我没有运气的尝试:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbars="none"
android:layout_weight="1">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:weightSum="1"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:weight="0.4"
android:src="@drawable/profileImg" />
<LinearLayout
android:weight="0.6"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:weightSum="1"
android:orientation="vertical">
<RelativeLayout
android:weight="0.25">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="10sp"
android:text="User ID"
android:textColor="#fff" />
<TextView
android:id="@+id/pUID"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="10sp"
android:text="pUID"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout
android:weight="0.25">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="10sp"
android:text="Full Name"
android:textColor="#fff" />
<TextView
android:id="@+id/fName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="10sp"
android:text="fName"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout
android:weight="0.25">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="10sp"
android:text="Age"
android:textColor="#fff" />
<TextView
android:id="@+id/pAge"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="10sp"
android:text="pAge"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout
android:weight="0.25">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="10sp"
android:text="Date of Birth"
android:textColor="#fff" />
<TextView
android:id="@+id/pDOB"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="10sp"
android:text="pDOB"
android:textColor="#fff" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
【问题讨论】:
-
显示您的 xml 代码。
-
显示一些东西...发布您的 XML 文件或其他东西...
-
@Aspicas 我添加了一些 axml