码农知识堂 - 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

  • 相关阅读:
    ASP.NET 中验证的自定义返回和统一社会信用代码的内置验证实现
    运动品牌推荐:2022年最值得入手的一些运动装备
    SpringBoot框架分层(View层、Controller层、Service层、Mapper层、pojo层)
    把样式直接转化成 Tailwindcss Plugin 吧
    vue 鼠标移入移出事件执行多次(尤其ie)
    拥抱 Spring 全新 OAuth 解决方案
    threejs
    Scala技术与架构-1
    pg故障修复记录
    OpenDeepWiki 导出仓库 Skill:把代码知识沉淀成企业可复用的 AI 资产
  • 原文地址:https://blog.csdn.net/zhangphil/article/details/133353649
  • 最新文章
  • 沪漂五周年了:我越来越迷茫了
    Agentic Skill Routing 实战:别再把所有 Skill 塞进 AI Agent 上下文
    MySQL-Seconds_behind_master的精度误差
    [MAF预定义ChatClient中间件-03]CachingChatClient——利用缓存省钱省时间
    AI的至暗历史:从万众期待到被政府撤资,AI的两次死亡徘徊
    Agent OS :五种驯服不确定性的范式
    PortSwigger SQL注入LAB11
    数据库即时编译JIT
    [Begin]AI Learn Data Day 0
    深度学习进阶(二十七)现代 LLM 的核心架构设计其二:SwiGLU
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
小工具 小游戏
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1

京公网安备 11010502049817号