Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何在android中使一张表具有一张图片和两个文本视图?_Java_Android - Fatal编程技术网

Java 如何在android中使一张表具有一张图片和两个文本视图?

Java 如何在android中使一张表具有一张图片和两个文本视图?,java,android,Java,Android,这是我的第一个问题,如果我问错了,请指导我。我想用一个表格来显示游戏中有图片、标题和简要描述的角色数量。单击某个角色后,用户将被转移到另一个视图中,在该视图中,他可以看到有关该角色的更多详细信息 假设您的布局可能包含文本视图(标题)在表格的第一行和图像视图(您的图片)和文本视图(简要说明)。您可以根据表格行的要求使用android:weightSum和android:layout\u weight <LinearLayout android:layout_width="fill_paren

这是我的第一个问题,如果我问错了,请指导我。我想用一个表格来显示游戏中有图片、标题和简要描述的角色数量。单击某个角色后,用户将被转移到另一个视图中,在该视图中,他可以看到有关该角色的更多详细信息

假设您的布局可能包含
文本视图(标题)
表格的第一行
图像视图(您的图片)
文本视图(简要说明)
。您可以根据
表格行的要求使用
android:weightSum
android:layout\u weight

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">

<TableLayout 
    android:layout_height="fill_parent"
    android:layout_width="wrap_content"
    android:weightSum="3"
 >

    <TableRow 
        android:layout_height="fill_parent"
        android:layout_width="fill_parent"
        android:layout_weight="1"
        >
        <TextView 
        android:layout_height="fill_parent"
        android:layout_width="fill_parent"
        android:layout_span="2"
        android:text="Title"
            />
    </TableRow>

    <TableRow 
        android:layout_height="fill_parent"
        android:layout_width="fill_parent"
        android:layout_weight="2"
        >
        <ImageView 
        android:layout_height="fill_parent"
        android:layout_width="fill_parent"
        android:src="drawable/...png"
            />
       <TextView 
        android:layout_height="fill_parent"
        android:layout_width="fill_parent"
        android:text="Brief Description"
            />
    </TableRow>
  </TableLayout>
  </LinearLayout>

您尝试过什么?你有代码给我们看吗?(除非你先尝试,否则你不太可能得到别人的帮助)。