Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/350.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/203.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 Linearlayout上图像视图下的文本视图_Java_Android_Xml - Fatal编程技术网

Java Linearlayout上图像视图下的文本视图

Java Linearlayout上图像视图下的文本视图,java,android,xml,Java,Android,Xml,我正在做一个项目,基本上我必须编写一个包含3个HorizantalsCrollView的XML文件。它们中的每一个都表示应用程序内商店中的项目。为了使项目水平,我使用线性布局,我可以正确地放置图像。问题是我无法在图像下添加文本视图 我正在尝试修复的特定XML部分 <HorizontalScrollView android:id="@+id/HSV1" android:layout_width="match_parent" android:layout_height=

我正在做一个项目,基本上我必须编写一个包含3个HorizantalsCrollView的XML文件。它们中的每一个都表示应用程序内商店中的项目。为了使项目水平,我使用线性布局,我可以正确地放置图像。问题是我无法在图像下添加文本视图

我正在尝试修复的特定XML部分

<HorizontalScrollView
    android:id="@+id/HSV1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:scrollbars="none"
    app:layout_constraintBottom_toTopOf="@+id/HSV2"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintHorizontal_bias="0.5"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintVertical_bias="0.13">

    <LinearLayout
        android:id="@+id/HSVL1"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:orientation="horizontal">

        <de.hdodenhof.circleimageview.CircleImageView
            android:id="@+id/button"
            android:layout_width="110dp"
            android:layout_height="110dp"
            android:layout_gravity="center"
            android:layout_marginLeft="20dp"
            android:src="@drawable/money"
            app:civ_border_width="2dp" />
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="16.95 TL"
            android:textSize="20dp" />
将android:orientation更改为android:orientation=vertical

试试这个-

<HorizontalScrollView
android:id="@+id/HSV1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="none"
app:layout_constraintBottom_toTopOf="@+id/HSV2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.13">

<LinearLayout
    android:id="@+id/HSVL1"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <de.hdodenhof.circleimageview.CircleImageView
        android:id="@+id/button"
        android:layout_width="110dp"
        android:layout_height="110dp"
        android:layout_gravity="center"
        android:layout_marginLeft="20dp"
        android:src="@drawable/money"
        app:civ_border_width="2dp" />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="16.95 TL"
        android:textSize="20dp" />

画出你想要的图片并贴在这里,因为它不清楚你想要做什么

将LinearLayout的方向更改为垂直。您的LinearLayout具有android:orientation=horizontal将其更改为android:orientation=vertical,以便文本视图位于图像视图下方我只想将文本视图放置在图像下方,因此更改方向没有帮助。如果您更改视图,文本视图将位于图像下方方向如果要对齐文本,请删除边距