码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • Android约束布局ConstraintLayout流式Flow


    Android约束布局ConstraintLayout流式Flow

    1. "1.0" encoding="utf-8"?>
    2. <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    3. xmlns:app="http://schemas.android.com/apk/res-auto"
    4. android:layout_width="match_parent"
    5. android:layout_height="match_parent">
    6. <androidx.cardview.widget.CardView
    7. android:layout_width="100dp"
    8. android:layout_height="100dp"
    9. app:cardBackgroundColor="@android:color/holo_orange_light"
    10. app:cardCornerRadius="50dp"
    11. app:layout_constraintDimensionRatio="1:1"
    12. app:layout_constraintEnd_toEndOf="parent"
    13. app:layout_constraintHorizontal_bias="0.8"
    14. app:layout_constraintStart_toStartOf="parent"
    15. app:layout_constraintTop_toTopOf="parent">
    16. <androidx.appcompat.widget.AppCompatImageView
    17. android:layout_width="match_parent"
    18. android:layout_height="match_parent"
    19. android:scaleType="centerCrop"
    20. android:src="@drawable/ic_launcher_foreground" />
    21. androidx.cardview.widget.CardView>
    22. <androidx.constraintlayout.helper.widget.Flow
    23. android:layout_width="0dp"
    24. android:layout_height="wrap_content"
    25. android:orientation="horizontal"
    26. app:constraint_referenced_ids="tv1,tv2,tv3,tv4,tv5,tv6,tv7"
    27. app:flow_horizontalGap="10dp"
    28. app:flow_verticalGap="20dp"
    29. app:flow_wrapMode="aligned"
    30. app:layout_constraintBottom_toBottomOf="parent"
    31. app:layout_constraintStart_toStartOf="parent"
    32. app:layout_constraintTop_toTopOf="parent" />
    33. <TextView
    34. android:id="@+id/tv1"
    35. android:layout_width="50dp"
    36. android:layout_height="wrap_content"
    37. android:background="@android:color/holo_green_dark"
    38. android:text="1" />
    39. <TextView
    40. android:id="@+id/tv2"
    41. android:layout_width="60dp"
    42. android:layout_height="wrap_content"
    43. android:background="@android:color/holo_orange_light"
    44. android:text="2" />
    45. <TextView
    46. android:id="@+id/tv3"
    47. android:layout_width="40dp"
    48. android:layout_height="wrap_content"
    49. android:background="@android:color/holo_red_dark"
    50. android:text="3" />
    51. <TextView
    52. android:id="@+id/tv4"
    53. android:layout_width="80dp"
    54. android:layout_height="wrap_content"
    55. android:background="@android:color/holo_green_light"
    56. android:text="4" />
    57. <TextView
    58. android:id="@+id/tv5"
    59. android:layout_width="100dp"
    60. android:layout_height="wrap_content"
    61. android:background="@android:color/holo_blue_light"
    62. android:text="5" />
    63. <TextView
    64. android:id="@+id/tv6"
    65. android:layout_width="60dp"
    66. android:layout_height="wrap_content"
    67. android:background="@android:color/holo_green_dark"
    68. android:text="6" />
    69. <TextView
    70. android:id="@+id/tv7"
    71. android:layout_width="30dp"
    72. android:layout_height="wrap_content"
    73. android:background="@android:color/holo_red_light"
    74. android:text="7" />
    75. androidx.constraintlayout.widget.ConstraintLayout>

    Android约束布局ConstraintLayout的Guideline,CardView-CSDN博客Android ConstraintLayout按比例缩放View关键点有两个,第一,使用Android ConstraintLayout的layout_constraintDimensionRatio属性,设置宽高比缩放比例,宽:高。Android ConstraintLayout按比例缩放View关键点有两个,第一,使用Android ConstraintLayout的layout_constraintDimensionRatio属性,设置宽高比缩放比例,宽:高。https://blog.csdn.net/zhangphil/article/details/133350654

    Android ConstraintLayout layout_constraintHorizontal layout_constraintDimensionRatio square CardView-CSDN博客Android ConstraintLayout按比例缩放View关键点有两个,第一,使用Android ConstraintLayout的layout_constraintDimensionRatio属性,设置宽高比缩放比例,宽:高。Android ConstraintLayout约束布局的居中_android constraintlayout 两个图片并排水平居中-CSDN博客。Android ConstraintLayout按比例缩放View_constraintlayout 比例-CSDN博客。https://blog.csdn.net/zhangphil/article/details/133324821

    Android ConstraintLayout app:layout_constraintHorizontal_weight-CSDN博客Android ConstraintLayout按比例缩放View关键点有两个,第一,使用Android ConstraintLayout的layout_constraintDimensionRatio属性,设置宽高比缩放比例,宽:高。Android ConstraintLayout约束布局的居中_android constraintlayout 两个图片并排水平居中-CSDN博客。Android ConstraintLayout按比例缩放View_constraintlayout 比例-CSDN博客。https://blog.csdn.net/zhangphil/article/details/133323625

  • 相关阅读:
    java废旧物品回收管理系统计算机毕业设计MyBatis+系统+LW文档+源码+调试部署
    WebSocket 入门案例
    【控制】模型预测控制 model predictive control 简介
    AWS无服务器 应用程序开发—第十六章 CI/CD CodeBuild
    枚举类和集合
    太阳直散追踪器
    TMS320C6678+Kintex-7开发板——DSP程序固化操作手册
    27 行为型模式-解释器模式
    openGauss内核:SQL解析过程分析
    虚拟机(VMware )如何固定系统IP
  • 原文地址:https://blog.csdn.net/zhangphil/article/details/133353649
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号