Android中alignBaseline和alignBottom有什么区别? [英] What's the difference between alignBaseline and alignBottom in Android?

查看:377
本文介绍了Android中alignBaseline和alignBottom有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我都尝试对齐两个TextView对象,它们给了我相同的结果. 基线"和底部"到底有什么区别?

I tried both to align a few TextView objects and they gave me the same results. What exactly is the difference between 'baseline' and 'bottom' ?

推荐答案

为显示差异,我通常想象在Word或Photoshop中有两个文本框.

To visualize the difference, I usually imagine two textboxes in Word or Photoshop.

  • alignBottom 将文本框的底部对齐. (蓝色轮廓)
    • 文本可能不均匀,但是它们位于其中的框会在底部对齐.
    • alignBottom lines up the bottom of the textboxes. (The blue outline)
      • Text could be uneven, but the boxes they're in would line up on the bottom.

      基线是一种印刷术术语,指的是看不见的行文本上.

      Baseline is a typography term that refers to the invisible line text is written on.

      (如 RelativeLayout中的基线是什么?)

      如果不小心,使用alignBaseline可能会使布局看起来像这样:

      If you're not careful, using alignBaseline could make your layout look like this:

      详细信息:观看基线对齐

      我不知道您是否还在寻找答案,但是我决定至少将其放在此处,因为这是第一个结果.

      I don't know if you're still looking for the answer, but I decided to at least put this out there since this was one of the first results.

      这篇关于Android中alignBaseline和alignBottom有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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