+-
Android PopUpWindow-如何设置边距?
我的PopUpWindow具有以下布局:

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"        
        android:background="@color/colorbg">    
</LinearLayout>

我尝试添加android:margin =“ 10dp”,但是它不起作用,它仍然位于右上角,根本没有任何余量.

谢谢.

最佳答案
我没有使用过PopUpWindow,但是Android文档显示了一种方法:

showAtLocation(View parent, int gravity, int x, int y)

点击查看更多相关文章

转载注明原文:Android PopUpWindow-如何设置边距? - 乐贴网