【问题标题】:how to center android Textview element at bottom of the screen如何在屏幕底部居中android Textview元素
【发布时间】:2015-05-06 20:18:18
【问题描述】:

我有使用 DroidDraw 的 android xml 布局: 链接:https://docs.google.com/document/d/1L3QJVwI9Znmeu1yANJXhDcZGFR70587d4oznu0hrZCw/edit?usp=sharing0

我需要将最后一个 Textview 底部对齐(打印屏幕中显示的黄色)。

我需要这个:

【问题讨论】:

标签: android html css


【解决方案1】:

这篇文章成功了。

stackOverflow link

我需要在我的布局上实现 layout_weight。基本上定义了页眉、内容和页脚的权重

【讨论】:

    【解决方案2】:

    在相对布局中使用:

        android:alignParentBottom="true" 
    

    在线性布局中使用:

        android:layout_weight="1.0"
        android:gravity="bottom|right"
    

    【讨论】:

      【解决方案3】:

      将父级相对布局属性设置为:

      android:layout_gravity = "bottom | left" 
      

      【讨论】:

        【解决方案4】:

        尝试使用

        android:alignParentBottom="true"
        

        如果我正确地看到 TextView 的父 ViewGroup 是一个 RelativeLayout

        【讨论】:

        猜你喜欢
        • 2011-08-10
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-10-24
        • 2016-01-27
        • 2021-03-30
        相关资源
        最近更新 更多