在Dialogs界限之外查看

eth*_*th0 12 android android-ui android-layout android-dialog

我想要这样的东西:

playstorereview

用户个人资料图片在对话框边界上"弹出".

我已经尝试了所有的东西:在太阳下乱用每个可能的组合剪辑,在对话框之后动态创建视图并将其添加到根内容视图,使用单独的视图并使用Dialog.setCustomTitle()加载,黑客攻击图像onDraw()方法并应用各种边界/位置黑客 - 但无论图像总是被剪切并分成两半.

我甚至已经去了解Play商店APK并看看他们是如何做到的.不幸的是,资源文件没有太大的余地,我在Smali找不到任何东西.

有人可以帮忙吗?请... :-(

编辑:我只是专门讨论对话框顶部的用户配置文件图像,而不是对话框本身.

MHP*_*MHP 29

对话方法:

Dialog dialog = new Dialog(this);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setContentView(R.layout.mhp);
    dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    dialog.show();  
Run Code Online (Sandbox Code Playgroud)

mhp.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/transparent" >

<LinearLayout
    android:id="@+id/linearLayout1"
    android:layout_width="match_parent"
    android:layout_height="100dp"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="57dp"
    android:background="#f00"
    android:orientation="vertical" >
</LinearLayout>

<ImageView
    android:id="@+id/imageView1"
    android:layout_width="100dp"
    android:layout_height="100dp"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:src="@drawable/ic_launcher" />

</RelativeLayout>  
Run Code Online (Sandbox Code Playgroud)

结果
结果图