5

I have implemented the popup menu on each item of the list view,the problem is when i click on the image view which is opening the popup menu.The popup menu's width is too big.

I need to reduce the width of the popup menu.As of now I have reduced the height,text size,text color,divider size & color and back ground color.

By modifying the below changes in style.xml(values folder of v-14 & v-11):

<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
    <!-- API 14 theme customizations can go here. -->

    <item name="android:dropDownListViewStyle">@style/PopupMenuListView</item>
    <item name="android:actionBarWidgetTheme">@style/PopupMenuTextView</item>
    <item name="android:popupMenuStyle">@style/PopupMenu</item>

    <!-- Change Overflow Menu ListView Item Height & Property -->
    <item name="android:listPreferredItemHeightSmall">30dp</item>
    <item name="android:listPreferredItemPaddingLeft">5dp</item>
    <item name="android:listPreferredItemPaddingRight">5dp</item>
</style>

<!-- Change Overflow Menu ListView Divider Property -->
<style name="PopupMenuListView" parent="@android:style/Widget.Holo.ListView.DropDown">
    <item name="android:divider">#dcdbdb</item>
    <item name="android:dividerHeight">2dp</item>
</style>

<!-- Change Overflow Menu ListView Text Size and Text Size -->
 <style name="PopupMenuTextView" parent="@style/android:Theme.Holo.Light">
    <item name="android:textColor">#00FF00</item>
    <item name="android:textSize">15sp</item>
</style>

 <!-- Change Overflow Menu Background -->
 <style name="PopupMenu" parent="android:Widget.Holo.Light.ListPopupWindow">
    <item name="android:popupBackground">#e3e3e3</item>
</style>
halfer
  • 19,824
  • 17
  • 99
  • 186
Asif Sb
  • 785
  • 9
  • 38
  • Try looking at this question: http://stackoverflow.com/questions/21469792/how-do-i-change-width-size-of-popup-items – Ivano Donadi Jul 23 '15 at 09:50

0 Answers0