如何在android中对齐文本

rya*_*yan 14 android

我想在android的左下角对齐我的文本.

syn*_*nic 36

如果要将TextView中的文本与左下角对齐,请使用android:gravity="bottom|left".如果要将TextView对齐到容器的左下角,请使用android:layout_gravity="bottom|left".

我怀疑你在这里错误地传达了你的真实意图.你想将一些文字对齐到左下角?屏幕?文本的容器?

请尝试更具体地回答您的问题.

屏幕左下方:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:gravity="bottom|left"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <TextView android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="text"/>
</FrameLayout>
Run Code Online (Sandbox Code Playgroud)