2015-09-06 76 views
0

我只是想移動的標誌,從中心到左邊的動作條,我想這樣的,但沒有奏效移動動作條標誌向左

<item name="logo">imgname</item> 
<item name="android:gravity">left</item> 

這是我的實際代碼

<style name="MyActionBar" 
parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse"> 
<item name="android:background">@drawable/emgtxtbg</item> 
<item name="logo">@drawable/emgtxt</item> 
<item name="displayOptions">useLogo|showHome</item> 
<!-- Support library compatibility --> 
<item name="background">@drawable/emgtxtbg</item> 

+0

嘗試參考以下鏈接, http://stackoverflow.com/questions/14210454/how-to-set-two-custom-actionbar-button-in-left-and-right-in-android –

回答

0

試試這個,

<ImageView 
android:id="@+id/imageView4" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:layout_alignParentRight="true" 
android:layout_alignParentTop="true" 
android:src="@drawable/adnace_search_i" /> 

如果您發現任何問題,請與我保持聯繫。

+0

我的錯,我試圖在我的customtheme.xml中做到這一點,你的回答是對的,但不適合我的情況 –