基本布局

编程入门 行业动态 更新时间:2024-10-12 18:22:16

基本<a href=https://www.elefans.com/category/jswz/34/1770549.html style=布局"/>

基本布局

没有方便的定位方式,所有控件都会默认的摆放在布局的左上角。有叠加效果。调整位置通过对齐方式调整

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android=""xmlns:app=""xmlns:tools=""android:layout_width="match_parent"android:layout_height="match_parent"tools:context=".MainActivity"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Hello World!"android:textColor="#444444"app:layout_constraintBottom_toBottomOf="parent"app:layout_constraintLeft_toLeftOf="parent"app:layout_constraintRight_toRightOf="parent"app:layout_constraintTop_toTopOf="parent" /><ImageViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:src="@mipmap/ic_launcher"/><!--因为ImageView在TextView后面所以图片压在文字上面--></FrameLayout>

更多推荐

基本布局

本文发布于:2024-02-19 14:59:59,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1764512.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:布局

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!