Android 文本与另一文本的右侧和底部对齐

Android 文本与另一文本的右侧和底部对齐,android,android-layout,Android,Android Layout,请原谅,我的下一张照片是匆忙拍的:): 请任何人告诉我,我如何在Android中使用布局和文本视图来获得类似于我画的东西。 带有一个文本的框是字符串,带有文本的框也是字符串 谢谢。在RelativeLayout中,在每个TextView标记内,根据您的要求使用这些属性 android:layout_below="Id of the TextView" android:layout_above="Id of the TextView" android:layout_toLeftOf="Id of

请原谅,我的下一张照片是匆忙拍的:):

请任何人告诉我,我如何在Android中使用布局和文本视图来获得类似于我画的东西。 带有一个文本的框是字符串,带有文本的框也是字符串


谢谢。

在RelativeLayout中,在每个TextView标记内,根据您的要求使用这些属性

android:layout_below="Id of the TextView"
android:layout_above="Id of the TextView"
android:layout_toLeftOf="Id of the TextView"
android:layout_toRightOf="Id of the TextView"

像这样的东西应该能奏效。按键为下方的
layout_
layout_toRightOf

<RelativeLayout
    android:layout_width="fill_parent" android:layout_height="fill_parent">
    <TextView android:id="@+id/LeftTextView"
         android:layout_width="wrap_content" android:layout_height="wrap_content"
         android:paddingRight="10dp" android:paddingBottom="10dp"
         android:text="HI">
    <TextView android:id="@+id/WholeTextView"
         android:layout_height="fill_parent" android:layout_width="fill_parent"
         android:layout_below="@id/LeftTextView"
         android:layout_toRightOf="@id/LeftTextView">
</RelativeLayout>


出于某种原因,这是一种糟糕的方法,即使它有效。我建议在最下面一行使用不同的文本视图。它可能与相对布局中的某些组合一起工作,但可能在每个屏幕/分辨率中都不相同。

我不认为在这种情况下可以使用2个TextView实例。一种解决方法是只使用一个TextView,并以编程方式进行文本格式化

你试过使用吗


textview2.setCompoundDrawables(textview1,null,null,null)

怎么做?我正在使用RelativeLayout。尝试了各种组合,但无法从图像中获得结果。