添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
+关注继续查看

代码中设置layout_constraintDimensionRatio:

ConstraintSet constraintSet = new ConstraintSet();
constraintSet.clone(mRlContent);
constraintSet.setDimensionRatio(R.id.iv,"h,9:16");
constraintSet.applyTo(mRlContent);

对应布局:

<androidx.constraintlayout.widget.ConstraintLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
    <ImageView
        android:id="@+id/iv"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:contentDescription="@null"
        app:layout_constraintTop_toTopOf="parent"
        tools:background="@drawable/ic_launcher" />
</androidx.constraintlayout.widget.ConstraintLayout>

参考:
https://www.jianshu.com/p/16e34f919e1a

终于建了一个自己个人小站:https://huangtianyu.gitee.io,以后优先更新小站博客,欢迎进站,O(∩_∩)O~~ 第一类:属性值 true或者 false android:layout_centerHrizontal 水平居中    android:layout_cent... Prompt learning 教学[进阶篇]:简介Prompt框架并给出自然语言处理技术:Few-Shot Prompting、Self-Consistency等;项目实战搭建知识库内容机器人