android - 如何在android中实现垂直标签布局?
问题描述
我正在尝试在平板电脑上运行的应用程序上实现垂直选项卡布局。我试图将 TabLayout 的方向设置为垂直但没有运气。
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<com.google.android.material.tabs.TabLayout
android:id="@+id/staff_menu_tabs"
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:orientation="vertical"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.google.android.material.tabs.TabItem
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="Tab 1"/>
<com.google.android.material.tabs.TabItem
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="Tab 2"/>
<com.google.android.material.tabs.TabItem
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="Tab 3"
/>
</com.google.android.material.tabs.TabLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
解决方案
推荐阅读
- python - 转换数据帧“to_csv”时如何在数值前面填充零?
- android - 在 Appcelerator Studio 中运行项目时出错
- xamarin.forms - ITMS-90809:不推荐使用的 API 使用 - Apple 将停止接受使用 UIWebView API 的应用程序的提交
- if-statement - 如何根据其他单元格值在具有背景颜色计数的谷歌工作表中计数或 sumif
- docx4j - 在最新版本的 xlsx4j 中为空 JaxbSmlPart
- vue.js - 处理 vue 中的组件的最佳解决方案是什么?
- android-studio - 当我尝试同步 Gradle 文件时出现以下错误:错误:无法解决:android.recyclerview:recyclerview: Affected Modules: app
- firebase - 如何从 Google Cloud IoT 核心获取活动设备列表
- ios - 绕过“使用 Apple 登录”
- java - 有没有办法在有或没有反射的情况下访问内部类中的私有方法