第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

Xamarin Android 將小部件工具欄圖標(biāo)向右對(duì)齊

Xamarin Android 將小部件工具欄圖標(biāo)向右對(duì)齊

C#
眼眸繁星 2021-06-04 15:18:59
我正在按照教程從這里制作側(cè)邊菜單 https://www.c-sharpcorner.com/article/xamarin-android-create-left-drawer-layout目前,菜單圖標(biāo)按鈕向左對(duì)齊,但我想將其向右對(duì)齊。我不知道如何更改圖標(biāo)對(duì)齊方式。在我的主要活動(dòng)中        protected override void OnCreate(Bundle bundle)    {        base.OnCreate(bundle);        SetContentView(Resource.Layout.menu);        V7Toolbar toolbar = FindViewById<V7Toolbar>(Resource.Id.toolbar);        SetSupportActionBar(toolbar);        SupportActionBar.SetDisplayHomeAsUpEnabled(true);        SupportActionBar.SetDisplayShowTitleEnabled(true);        SupportActionBar.SetHomeButtonEnabled(true);        SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.menu_icon);        drawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawer_layout);        navigationView = FindViewById<NavigationView>(Resource.Id.nav_view);    }        public override bool OnOptionsItemSelected(IMenuItem item)    {        switch (item.ItemId)        {            case Android.Resource.Id.Home:                drawerLayout.OpenDrawer(Android.Support.V4.View.GravityCompat.End);                return true;        }        return base.OnOptionsItemSelected(item);    }然后在作為內(nèi)容視圖加載的 menu.axml 中    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:app="http://schemas.android.com/apk/res-auto"    android:orientation="vertical"    android:layout_width="match_parent"    android:fitsSystemWindows="true"    android:layout_height="match_parent">    <android.support.v7.widget.Toolbar        android:id="@+id/toolbar"        android:layout_width="match_parent"        android:layout_height="65.5dp"        android:minHeight="?attr/actionBarSize"        android:background="#ff356f4d"
查看完整描述

1 回答

?
桃花長(zhǎng)相依

TA貢獻(xiàn)1860條經(jīng)驗(yàn) 獲得超8個(gè)贊

使用以下代碼在工具欄中進(jìn)行更改。這樣您就可以自定義您的工具欄。


替換這個(gè):


  <android.support.v7.widget.Toolbar

    android:id="@+id/toolbar"

    android:layout_width="match_parent"

    android:layout_height="65.5dp"

    android:minHeight="?attr/actionBarSize"

    android:background="#ff356f4d"

    app:popupTheme="@style/ThemeOverlay.AppCompat.Light"

    app:layout_scrollFlags="scroll|enterAlways"

    app:title="Overview - House 1"

    app:titleTextColor="#ffffff"

    android:layout_marginLeft="0.0dp"

    android:layout_marginBottom="0.0dp" 

    android:layout_gravity="right"/>

這樣:


    <android.support.v7.widget.Toolbar

    android:id="@+id/toolbar"

    android:layout_width="match_parent"

    android:layout_height="wrap_content"

    android:minHeight="?attr/actionBarSize"

    android:background="#33B86C"

    app:layout_scrollFlags="scroll|enterAlways">


        <FrameLayout

            android:layout_width="match_parent"

            android:layout_height="wrap_content"

            >


            <TextView

                android:id="@+id/toolbar_tv_title"

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:layout_gravity="center"

                android:maxLines="1"

                android:textColor="#FFFFFF"

                android:textAllCaps="true"

                android:textSize="18sp"

                android:text="Home"/>


            <ImageView

                android:id="@+id/toolbar_iv_right"

                android:layout_width="30dp"

                android:layout_height="30dp"

                android:layout_gravity="end"

                android:layout_marginEnd="10dp"

                android:contentDescription="@null"

                android:src="@drawable/menu_icon" />


        </FrameLayout>


    </android.support.v7.widget.Toolbar>


查看完整回答
反對(duì) 回復(fù) 2021-06-05
  • 1 回答
  • 0 關(guān)注
  • 227 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)