Hi All , i have dialog style activity
android:theme="@android:style/Theme.Dialog"
When i attached context menu to it
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
MenuItem item = null;
item = menu.add(0, Menu.FIRST, Menu.NONE, "Test Context Menu in
Dialog Theme");
item.setIcon(android.R.drawable.ic_menu_edit);
return true;
}
The menu appears about 50 px from the bottom of this dialog. So if
activity screen is too small - it right in the middle of the screen.
Is there any way to anchor menu to the bottom of the screen ?
layout :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10sp"
android:src="@drawable/icon" />
<TextView
android:id="@+id/title"
android:layout_toRightOf="@id/icon"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignTop="@id/icon"
android:layout_alignBottom="@id/icon"
android:gravity="left|center"
android:text="Title" />
<ImageView
android:id="@+id/divider"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/icon"
android:layout_gravity="left"
android:src="@drawable/dialog_divider_horizontal_light" />
<TextView
android:id="@+id/note"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/divider"
android:layout_marginLeft="10sp"
android:layout_marginBottom="10sp"
android:layout_marginTop="10sp"
android:text="Some Text" />
</RelativeLayout>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---