android - Popup Menu at bottom of a view -


how show popup menu @ bottom of anchor view. code i'm using display popup menu.

 popupmenu popup = new popupmenu(activityreference, view, gravity.no_gravity);                 popup.getmenuinflater()                     .inflate(r.menu.popup_menu_event_edit, popup.getmenu()); popup.show(); 

i have tried changinging gravity.no_gravity gravity.bottom. not working.

it worked me

popupmenu attachfilepopup = new popupmenu(this, view ,gravity.bottom); attachfilepopup.inflate(r.menu.attachment_choices); 

view => bottom button want show menu

attachment_choices.xml

<item     android:id="@+id/attach_location"     android:title="@string/send_location"/>  <item     android:id="@+id/attach_record_voice"     android:title="@string/attach_record_voice"/>  <item     android:id="@+id/attach_take_picture"     android:title="@string/attach_take_picture"/>  <item     android:id="@+id/attach_choose_picture"     android:title="@string/attach_choose_picture"/>  <item     android:id="@+id/attach_choose_file"     android:title="@string/choose_file"/> 


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -