android - android:constraintLayout中的视图不更新
问题描述
我有视图(activeListeningView),当我从 api 调用得到响应时,我想让它可见。我的问题是 activeListeningView 变得可见但 viewpager 覆盖它并且不关心边距。我尝试了很多方法,但没有任何效果
<com.irantracking.ptt.common.view.ActiveListeningView
android:id="@+id/active_listening"
android:layout_width="match_parent"
android:layout_height="56dp"
android:visibility="gone"
android:layout_marginTop="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="parent"/>
<androidx.viewpager.widget.ViewPager
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="16dp"
app:layout_goneMarginTop="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/active_listening" />
解决方案
推荐阅读
- karate - 我们可以在空手道 UI 代码之间集成 selenium 代码吗?
- react-native - 如何在 Java MainActivity/Main Application 文件中更改包名称
- db2 - 超过 5 个连接的最大限制。拒绝连接
- firebase - 为什么无法在 Cloud Firestore 中的不同字段上进行 orderBy,我该如何解决?
- node.js - Node js mongoose MissingSchemaError: Schema还没有为模型注册
- chart.js - 具有多个级别或类别的图表 Js 堆积条形图
- ios - Ionic 应用程序在卸载后不会删除本地数据
- mysql - i am trying to join the tables and get the data by using the join querys in mysql
- jmeter - 如何使用机器人框架执行特定的 HTTP 请求
- batch-file - 如何删除所有以 0x00 为内容的文件?