gpt4 book ai didi

导航栏中的 Android 图标

转载 作者:行者123 更新时间:2023-11-30 00:52:11 41 4
gpt4 key购买 nike

我怎样才能在 android studio 中做这样的事情:

Navigation bar with Title and Icon and Menue

我想要一个导航栏,您可以在其中看到名称、图标以及打开抽屉导航的机会 :D

(图片是用Figma制作的)

最佳答案

将重力设置为在 DrawerLayout 内的 NavigationView 中结束。并将自定义 View 添加到工具栏。

<DrawerLayout ...>
<Content>
<Toolbar>
<LinearLayout
android:orientation="horizontal">
<!-- Here goes the Image -->
<ImageView .../>
<!--Here goes the title -->
<TextView ...
android:gravity="center"/>
</LinearLayout>
</Toolbar>
<MainContent .../>
</Content>
<NavigationView
android:layout_gravity="end"
.../>
</DrawerLayout>

这应该可以帮助您入门。

关于导航栏中的 Android 图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40832290/

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