`

简单弹出框

阅读更多

这里介绍弹出框的简单实现方式:

 

1 常用的弹框方式(更多使用见:http://blog.csdn.net/chenlei1889/article/details/6267406#):

new AlertDialog.Builder(MainActivity.this) 
				.setTitle("确认")
				.setMessage("确定吗?")
				.setPositiveButton("是", null)
				.setNegativeButton("否", null)
				.show();

 

 

 

2 在布局文件里,加上一个view层,如弹出新浪微博登陆框后,将该层显示出来,登陆框消失后,也将该层的可见性设置为GONE:

<LinearLayout
        android:id="@+id/login_cover"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="#cb000000"
        android:visibility="gone" >
    </LinearLayout>

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics