如何在布局上放置方形尺寸的广告

问题描述 投票:-1回答:1

我想在我的应用程序布局上放置方形广告我尽我所能但没有得到任何关于方形广告的信息我在下面添加图片请给我一些建议look here

android
1个回答
0
投票

您可以将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" />

© www.soinside.com 2019 - 2024. All rights reserved.