gpt4 book ai didi

android - 我将如何在 XML 中重新创建此标准均衡器布局?

转载 作者:行者123 更新时间:2023-11-30 01:19:20 25 4
gpt4 key购买 nike

我目前正在研究一个简单的均衡器,以扩展我对如何创建好的布局以及实现它们的正确方法的了解。我在这里想要实现的是 5 个垂直 SeekBars 以及 3 个 TextViews,它们将落入子布局。总共有 5 个子布局属于父布局。

这是我草拟的一个快速演示...

enter image description here

我不太熟悉 android 布局的工作原理,所以我希望这能帮助我和其他人学习如何正确组合布局,然后我可以使用它进入更高级的领域。

有什么想法吗?谢谢!

最佳答案

试试这个 xml 使用 android:layout_weight 标签:

你可以使用这个库

https://github.com/h6ah4i/android-verticalseekbar

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/llCamera"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin">

<TextView
android:text="xx"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>

<TextView
android:text="xx"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>

<com.h6ah4i.android.widget.verticalseekbar.VerticalSeekBarWrapper
android:layout_width="wrap_content"
android:layout_height="150dp">
<com.h6ah4i.android.widget.verticalseekbar.VerticalSeekBar
android:id="@+id/mySeekBar"
android:layout_width="0dp"
android:layout_height="0dp"
app:seekBarRotation="CW90" /> <!-- Rotation: CW90 or CW270 -->
</com.h6ah4i.android.widget.verticalseekbar.VerticalSeekBarWrapper>


<TextView
android:text="xx"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>


</LinearLayout>

关于android - 我将如何在 XML 中重新创建此标准均衡器布局?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37363550/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com