I am Trying to change the Height of ActionBar,the code i use is shown below
MainActivity:
public class MainActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ActionBar actionBar = getSupportActionBar(); actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM); View view = View.inflate(getApplicationContext(), R.layout.actionbarview, null); actionBar.setCustomView(view); } } Values/styles.xml:
<style name="CustomActionBarTheme" parent="@style/Theme.AppCompat.Light"> <!-- Support library compatibility --> <item name="actionBarStyle">@style/MyActionBar</item> </style> <!-- general styles for the action bar --> <style name="MyActionBar" parent="@style/Widget.AppCompat.ActionBar"> <item name="actionBarSize">700dp</item> </style> Values-v11/styles.xml
<style name="CustomActionBarTheme" parent="@style/Theme.AppCompat.Light"> <item name="android:actionBarStyle">@style/MyActionBar</item> </style> <!-- general styles for the action bar --> <style name="MyActionBar" parent="@style/Widget.AppCompat.ActionBar"> <item name="android:actionBarSize">700dp</item> </style> actionbarview.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="match_parent" android:layout_gravity="fill_horizontal" android:background="#555333" android:orientation="horizontal" > <Button android:layout_width="100dp" android:layout_height="100dp" android:layout_alignParentLeft="true" android:layout_centerVertical="true" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:text="Title mswg" /> <Button android:layout_width="100dp" android:layout_height="100dp" android:layout_alignParentRight="true" android:layout_centerVertical="true" /> </RelativeLayout>` The problem is not the height does not change.My target sdk is 17.
Thanks in Advance!