gpt4 book ai didi

android - layout_below 带有动态文本的 TextView

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

我有一个包含两个 TextView 的 RelativeLayout,第二个应该在第一个下面。第一个 TextView 的文本在 onCreate() 中更新,文本包含换行符,这使得它更高,但第二个 TextView 在此之后没有重新定位,导致它们重叠。我该如何解决这个问题?

<RelativeLayout
android:id="@+id/layout_parent"
android:layout_width="fill_parent"
android:layout_height="wrap_content">

<TextView
android:id="@+id/textView_top"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

<TextView
android:id="@+id/textView_bottom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/textView_top"/>
</RelativeLayout>

最佳答案

一个垂直的 Linearlayout 可以解决这个问题并且效率更高。

关于android - layout_below 带有动态文本的 TextView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34111167/

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