我要创建的布局定制对话框如图所示的图片。 交叉/关闭按钮必须在右上方。 请建议我怎样才能实现这种布局。
I want to create a custom dialog with the layout as shown in the picture. The cross/close button must be on the top right side. Please suggest how can i achieve this kind of layout.
在此先感谢。
可能会低于code是对您有用,取得这样的
might be below code is useful for you,achieved like this
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center"
android:orientation="vertical" >
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:layout_marginTop="10dp"
android:background="@drawable/popup_password_latest"
android:gravity="center"
android:orientation="vertical"
android:paddingBottom="-50dp" >
<!---add your views here-->
</LinearLayout>
<ImageView
android:id="@+id/imageView_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|right"
android:clickable="true"
android:src="@drawable/close_selector" />
</FrameLayout>
</LinearLayout>
上一篇:mService.consumePurchase(3,的packageName,purchaseToken)总是返回RESULT_DEVELOPER_ERROR = 5 - 提供给API的参数无效提