android - 如何将约束放在片段上?
问题描述
我有一个带有两个 TextView 和一个 ImageView 的 Fragment,我想将约束放在这个视图上。我该怎么做?因为我在 Fragments 上只有边距,但在 Attributes 上看不到 Layout Constraints。
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".saludoscongratulationsfragment">
<!-- TODO: Update blank fragment layout -->
<TextView
android:id="@+id/titulo"
android:layout_width="300dp"
android:layout_height="95dp"
android:layout_marginTop="16dp"
android:text="Lección completada!"
android:textColor="@android:color/holo_red_dark"
android:textSize="30sp"
/>
<ImageView
android:id="@+id/fuegosartificiales"
android:layout_width="match_parent"
android:layout_height="386dp"
android:layout_marginTop="92dp" />
谢谢
解决方案
推荐阅读
- spring - 如何从 Spring Boot 设置任意 system.property?
- r - 返回子区间数的函数?
- heroku - 无法在 cygwin 上启动 heroku cli
- intellij-idea - Intellij 项目视图不显示日志文件
- javascript - html2canvas 打印模态区域
- javascript - 从 ~ 同级元素 innerText val 将“ids”添加到复选框元素
- php - 使用 PHPMailer 的目录中的电子邮件附件并不总是最新的
- batch-file - 将“wmic csproduct get vendor /format:list | findstr/c=”的输出存储为变量时遇到问题
- javascript - 如何更新 .ejs 模板中的数据?
- python - apscheduler 在heroku 上完美运行,但在本地scrapyd 上却不行