我可以在android studio中浮动到左上角的工具栏图标吗?
我有这个: 但我想将主图标浮动到左上角,如: 我已将其放入我的我可以在android studio中浮动到左上角的工具栏图标吗?,android,android-studio,Android,Android Studio,我有这个: 但我想将主图标浮动到左上角,如: 我已将其放入我的菜单\u main.xml文件中 <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas
菜单\u main.xml
文件中
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".MainActivity">
<item
android:id="@+id/action_notificaciones"
android:orderInCategory="300"
android:title="User"
android:icon="@drawable/ic_notificaciones"
app:showAsAction="ifRoom"></item>
<item
android:id="@+id/action_home"
android:orderInCategory="300"
android:title="User"
android:icon="@drawable/ic_go_home"
app:showAsAction="ifRoom"></item>
</menu>
我怎么能这样做?有什么帮助吗?u可以使用工具栏,为图标设置imageview,为标题设置textview,这是一个示例
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbarTransaction"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="50dp"
android:src="@drawable/img_vireopos_icon"/>\
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="4"
android:textSize="10pt"
android:text="testing"/>
<ImageView
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="50dp"
android:src="@drawable/img_vireopos_icon"/>\
</LinearLayout>
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.AppBarLayout>
\
\