【发布时间】:2014-03-06 06:43:11
【问题描述】:
如何在android活动的右上角显示对话框。
下面是我的对话框代码
item.xml
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="150dp"
android:layout_height="wrap_content" >
<com.CustomToggleButton
android:id="@+id/toggleButton2"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:textOff="@string/off_txt"
android:textOn="@string/on_txt" />
</TableLayout>
ActivityMy.java
dialog_box = new Dialog(ActivityMy.this);
dialog_box.setContentView(R.layout.item);
dialog_box.show();
【问题讨论】: