这是我想设计为自定义对话框布局的下面的图像,我的问题是:我不能将圆形imageview放在对话框顶部的布局上作为对话框图标
我的布局xml文件:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_gravity="center">
<ir.pishguy.signalpresentationproject.Widgets.CircularRevealView
android:id="@+id/reveal"
android:layout_width="match_parent"
android:layout_height="350dp"
android:layout_gravity="center"/>
<FrameLayout
android:id="@+id/frame"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<de.hdodenhof.circleimageview.CircleImageView
android:layout_width="55dp"
android:layout_height="55dp"
android:src="@drawable/ic_messages"
app:civ_border_color="#ffffff"
app:civ_border_width="5dp"
android:layout_marginTop="-35dp"
android:id="@+id/store_avatar"
android:layout_gravity="top"/>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="New Text"/>
<TextView
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="New Text"/>
</LinearLayout>
</ScrollView>
</LinearLayout>
</FrameLayout>
</FrameLayout>
我的布局屏幕截图:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="@android:color/transparent">
<LinearLayout
android:id="@+id/linearLayout3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginTop="55dp"
android:background="@android:color/holo_blue_dark"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="60dp"
android:text="@string/app_name"
android:textColor="@android:color/black"
android:textSize="22sp"
android:textStyle="bold" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:background="@android:color/white"
android:gravity="center"
android:text="Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! "
android:textColor="@android:color/black"
android:textSize="18sp" />
<Button
android:id="@+id/alert_btn_cancel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:background="#FF00F5"
android:text="Done"
android:textColor="@android:color/white"
android:textSize="18sp" />
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:src="@mipmap/ic_launcher" />
</RelativeLayout>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句