什么是最佳的宽度/高度与对机器人的使用方法:layout_align *? [英] What is the optimal width/height to use with pairs of android:layout_align*?

查看:202
本文介绍了什么是最佳的宽度/高度与对机器人的使用方法:layout_align *?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我们说我有:

    <View
        android:layout_alignTop="@id/someOtherView"
        android:layout_alignBottom="@id/someOtherView" />

要避免错误(如果的RuntimeException前不检查),我需要指定的android:layout_height 结果
什么价值preferable?它无论如何都会被覆盖,但也有可能像那些导致 0dip / PX的preference一些性能问题的LinearLayout 儿童的重量。结果
所以 - 0dip 1px的 FILL_PARENT (我挑衅地相信这是不是一个更合适的名称 match_parent )或 WRAP_CONTENT

To avoid errors (RuntimeException if not checking before), I need to specify android:layout_height.
What value is preferable? It will be overridden anyway, but there may be some performance issues like those that lead to the preference of 0dip/px for LinearLayout children with weights.
So - 0dip, 1px, fill_parent (I defiantly believe this to be a more appropriate name than match_parent), or wrap_content?

推荐答案

您可以使用 layout_height =0dp

这篇关于什么是最佳的宽度/高度与对机器人的使用方法:layout_align *?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆