Created
January 22, 2012 06:09
-
-
Save aztack/1655865 to your computer and use it in GitHub Desktop.
custom dialog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LayoutInflater inflater = getLayoutInflater(); | |
View layout = inflater.inflate(R.layout.dialog, | |
(ViewGroup) findViewById(R.id.dialog)); | |
new AlertDialog.Builder(this).setTitle("自定义布局").setView(layout) | |
.setPositiveButton("确定", null) | |
.setNegativeButton("取消", null).show(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_height="wrap_content" android:layout_width="wrap_content" | |
android:background="#ffffffff" android:orientation="horizontal" | |
android:id="@+id/dialog"> | |
<TextView android:layout_height="wrap_content" | |
android:layout_width="wrap_content" | |
android:id="@+id/tvname" android:text="姓名:" /> | |
<EditText android:layout_height="wrap_content" | |
android:layout_width="wrap_content" android:id="@+id/etname" android:minWidth="100dip"/> | |
</LinearLayout> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment