在相对布局的上下文中使用时,"基线"是指什么?可能是一个简单的问题,但文档和谷歌没有提示.
请在下面找到我的布局及其结果; 我需要文本" 文本消息 "在文本" 标题 " 的基线上对齐(请在下面的代码和快照中找到).如果有人可以给我指导,我会很高兴的
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="1.0"
android:baselineAligned="true"
>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.2"
android:background="@color/custom_orange"
android:gravity="center"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Header"
android:textSize="25sp"
android:id="@+id/title"
android:gravity="center"
android:background="@color/custom_red"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Text message"
android:textSize="10sp"
android:id="@+id/language"
android:gravity="center"
android:background="@color/custom_green"/>
</LinearLayout>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
这是结果

这就是我需要的

我在水平纸上有两个标签UIStackView。标签1是大字体(警报时间),标签2是小字体(AM / PM指示器),我想对齐每个标签的底部。
我已将堆栈视图的对齐方式设置为“底部”,但似乎只是对齐标签总面积的底部而不是实际文本的底部。结果是较小字体的底边比大标签底边高约3或4个像素。我该如何解决?
在.xml Android Studio中,两者之间有什么区别?
1)“ 端边缘 ”和“ 右边缘 ”?
2)“ toEndOf ”和“ toRightOf ”?
3)“ 起始边缘 ”和“ 左边缘 ”?
4)“ alignBaseline ”和“ alignBottom ”?