android - 当我使用消失/可见时重新计算重量布局
问题描述
我有一个底部导航视图,我想隐藏它,然后在出现特定片段时显示它。
问题是,当我使用 Gone 和或 Visible 时,视图会重新计算,然后需要一段时间来更改片段并且它会弄乱顶部导航栏,因为它会由于重新计算而改变高度。
我应该使用什么样的布局来避免重新计算?
这是 axml :
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/internal_main_layout"
android:background="@android:color/holo_red_light"
android:orientation="vertical"
android:minHeight="100dp"
android:layout_width="match_parent"
android:layout_height="match_parent">
<MyApp.Droid.Views.TopNavigation
android:id="@+id/internal_top_navbar"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" >
</MyApp.Droid.Views.TopNavigation >
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="8"
android:layout_above="@+id/bottom_navigation"/>
<Myapp.Droid.Views.BottomNavigation
android:id="@+id/internal_bottom_navigation"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
</Myapp.Droid.Views.BottomNavigation >
</LinearLayout>
是否有另一种方法可以响应并避免重新计算渲染?
解决方案
推荐阅读
- c# - 我正在尝试将值传递给 dateTime 对象,但是当月小于 month10 时出现问题
- http - Golang gin 仅在 ipv4 中获取客户端 IP
- python - Pandas - 逗号分隔行中的每个字符串在数据框中出现的频率
- jetbrains-ide - 使用 cmd-shift-f 搜索 IntelliJ / Android Studio 将随机字符注入搜索框
- php - 使用 mysql_i 连接到数据库时出错 - 拒绝访问
- javascript - 我正在尝试为我的应用程序制作占位符图像以在没有可用图像时做出反应
- c# - Aspose Words:获取每个附加文档的警告
- delphi - 如何在电子邮件中发送字符串列表并更改文本的对齐方式和格式
- c# - 如何在不显示浏览器的情况下从 Win Form 应用程序上的 IdentityServer 注销
- ios - 尝试使用 ADMob 添加插页式广告时出现错误