Android 我如何设置时间线,它可以根据我的布局进行调整
我想在我的recycler视图上设置一个时间线,但是如果我的内容有很多单词,我就不能调整时间线,这意味着当高度更高时 以下是我关于时间线设置的布局:Android 我如何设置时间线,它可以根据我的布局进行调整,android,Android,我想在我的recycler视图上设置一个时间线,但是如果我的内容有很多单词,我就不能调整时间线,这意味着当高度更高时 以下是我关于时间线设置的布局: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:la
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ffffff"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:clickable="true"
android:background="?android:attr/selectableItemBackground">
<ImageView
android:id="@+id/image"
android:layout_width="15dp"
android:layout_height="15dp"
android:layout_marginLeft="5dp"
android:layout_marginTop="0dp"
android:src="@drawable/pink_circle" />
<View
android:id="@+id/line_normal"
android:layout_width="1dp"
android:layout_height="wrap_content"//I set wrap , but if my conten has a lots of word , my layout will be cut , it's not good
android:layout_below="@+id/image"
android:layout_marginLeft="11.5dp"
android:background="@android:color/darker_gray" />
<TextView
android:text="TextView"
android:textSize="18dp"
android:textColor="@android:color/black"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textType"
android:layout_alignLeft="@+id/textType"
android:layout_alignStart="@+id/textType"
android:layout_marginTop="5dp"
android:id="@+id/textTitle" />
<TextView
android:id="@+id/textType"
android:text="Type"
android:textStyle="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dp"
android:textSize="12dp"
android:background="@android:color/holo_blue_bright"
android:textColor="@android:color/background_light"
android:layout_marginLeft="11dp"
android:layout_marginStart="11dp"
android:layout_alignParentTop="true"
android:layout_toRightOf="@+id/image"
android:layout_toEndOf="@+id/image" />
<TextView
android:textSize="18dp"
android:id="@+id/textDate"
android:layout_alignParentRight="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
</LinearLayout>
你说的时间线是什么意思?你希望你的用户界面看起来像什么?你能给我们看看你的用户界面是什么样子吗?可能附加一张图片?我想你没有尝试使用布局,因为android:layout\u height=“wrap\u content”//将80dp更改为wrap\u content
会很棘手…对不起,我的错,你是对的,它在我编译时显示了正确的高度。现在很好,谢谢你们的回复。
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"//change 80dp to wrap_content
android:clickable="true"
android:background="?android:attr/selectableItemBackground">