gpt4 book ai didi

xml - 设置安卓 :layout_toRightOf= causes textview to disappear

转载 作者:行者123 更新时间:2023-11-30 03:13:43 25 4
gpt4 key购买 nike

我试图并排设置两个 TextView :

  • userVideouploaderTextView
  • userVideoviewsTextView

但是,如果我设置 userVideouploaderTextViewandroid:layout_toRightOf="@id/userVideouploaderTextView",就会遇到问题。

userVideoviewsTextView 消失了。

这是我的布局代码:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<com.idg.omv.ui.widget.UrlImageView
android:id="@+id/userVideoThumbImageView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/black"
android:clickable="false"
android:contentDescription="YouTube video thumbnail"
android:focusable="false"
android:focusableInTouchMode="false"
android:gravity="center"
android:scaleType="fitCenter"
android:src="@drawable/ic_launcher" />

<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:visibility="invisible" />

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >

<TextView
android:id="@+id/userVideoTitleTextView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="5dip"
android:text="Video Title Not Found"
android:textColor="@android:color/black"
android:textSize="20sp" />

<Button
android:id="@+id/fav_up_btn1"
android:layout_width="27dp"
android:layout_height="27dp"
android:layout_alignParentRight="true"
android:background="@drawable/fav_up_btn1"
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:gravity="right"
android:paddingRight="5dp"
android:paddingTop="5dp" />
</RelativeLayout>

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >

<TextView
android:id="@+id/userVideouploaderTextView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="@android:color/black"
android:textSize="16sp" />

<TextView
android:id="@+id/userVideoviewsTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/userVideouploaderTextView"
android:textColor="@android:color/black"
android:textSize="14sp" />
</RelativeLayout>

<View
android:layout_width="match_parent"
android:layout_height="11dp"
android:visibility="invisible" />

</LinearLayout>

最佳答案

因为您的 View userVideouploaderTextViewwidth="fill_parent" 更改为 wrap_content 或固定 dp

关于xml - 设置安卓 :layout_toRightOf= causes textview to disappear,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20499651/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com