下面是一张图片来帮助我解释我的问题:TextView不从左侧开始
黑框是整个屏幕。红色框是TextView
。绿色是文字。当我运行我的代码时,它看起来像左边的屏幕,但我希望它看起来像它在右边。 (左起开始)
这里是TextView
代码:
<TextView
android:id="@+id/info_ruta"
android:layout_width="256dp"
android:layout_height="80dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="@string/info_sumary"
android:textColor="#FFF"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/day_seven_id" />
当试图添加android:gravity="left"
或="start"
它不与我的问题有所帮助。我在这里错过了什么?
使用'android:layout_width =“match_parent”'并确保容器也应该具有match_parent,如果问题仍然存在,请在整个布局后留言 –
什么是父布局?尝试发布您的完整布局。 –
@PavneetSingh照顾我的问题!谢谢! “回答”,如果你想我接受并赞扬。 – Carlton