[英]Navigation drawer icon gets disappeared on setting CustomView in actionbar
[英]setting customView in actionBar
我正在編寫一個用於樣式化應用程序的ActionBar的視圖,而該視圖可以完美地縱向運行,而在橫向視圖中會剪裁固定在底部的線條? 是否因為為ActionBar分配了一定的高度並且我的自定義視圖大於此高度? 這是我的自定義視圖的XML:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#252525" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:src="@drawable/ac_logo" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/imageView1" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="2dp"
android:layout_weight="1"
android:background="#F0C46C" >
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="2dp"
android:layout_weight="1"
android:background="#FFFFFF" >
</LinearLayout>
</LinearLayout>
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:scaleType="fitXY"
android:src="@drawable/ac_text" />
好的,我想通了,我將其發布,以防萬一碰巧看到此問題的任何人:)
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#252525" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:src="@drawable/ac_logo" />
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:scaleType="fitXY"
android:src="@drawable/ac_text" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/imageView1">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="2dp"
android:layout_weight="1"
android:background="#F0C46C" >
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="2dp"
android:layout_weight="1"
android:background="#FFFFFF" >
</LinearLayout>
</LinearLayout>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.