4

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"たが、うまくいきません。右上にあり、余白はありません。

ありがとう。

4

2 に答える 2

3

私自身は使用していませんPopUpWindowが、Android ドキュメントには方法が示されています。

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

于 2012-08-27T06:29:33.077 に答える
2

このandroid:padding="10dip"を試してください

<?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:padding="10dip"        
    android:background="@color/colorbg">    
</LinearLayout>

また

カスタム PopupWindow を試す ここをクリック

于 2012-08-27T06:30:25.470 に答える