android - 如何在布局上放置方形广告
问题描述
我想在我的应用布局上放置方形广告我已尽力但没有得到任何关于方形广告的信息我也在下面添加图片请给我一些建议看看这里
解决方案
您可以将 ConstraintLayout 与 app:layout_constraintDimensionRatio 一起使用:
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/imageView"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintDimensionRatio="H,1:1" />
推荐阅读
- vagrant - 我可以在 Vagrant 中安装共享文件夹之前强制进行配置吗?
- reactjs - 将数据添加到 Firebase 中的现有节点
- ios - 自定义 AlertView 控制器未显示视图控制器的顶部?
- uwp - 使用 AdControl.Suspend() 方法并将 AdControl 可见性更改为 Collapsed 是否有任何限制?
- java - 从另一个类中检索值
- angular - 在Angular 2中将Base64字符串转换为pdf
- linux - pypy3 安装密码学失败
- c# - 当我从 NT 服务访问上下文时,为什么会有一个非空的 HttpContext.Current?
- azure - 有没有办法从 nginx-kubernetes 入口提供外部 URL?
- javascript - 如何从解析平台检索对象并使用 Typescript 显示它们?