怎么设计这个?

时间:2016-04-14 05:54:32

标签: android android-layout

我正在设计注册屏幕。我需要将按钮放在圆形图像的底角,这是我的输出,我正在使用github的第三方库 de.hdodenhof:circleimageview:2.0.0 现在我想将相机底部放在图像视图的右下角 Output 需要输出 Needed Output

   <?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.this_pc.framelayout.MainActivity"
    android:background="@color/white">

    <RelativeLayout
        android:id="@+id/relativeLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <FrameLayout
            android:id="@+id/frameLayout"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <ImageView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="#FFFFFF"
                android:contentDescription="Image Border"
                android:padding="0dp"/>

            <de.hdodenhof.circleimageview.CircleImageView
                xmlns:app="http://schemas.android.com/apk/res-auto"
                android:id="@+id/profile_image"
                android:layout_width="300dp"
                android:layout_height="300dp"
                android:src="@drawable/profile"
                app:civ_border_width="2dp"
                app:civ_border_color="#FF000000"
                android:layout_gravity="center_horizontal"
                android:background="@drawable/round_border"/>
            <Button
                android:layout_alignParentRight="true"
                android:layout_alignParentBottom="true"
                android:layout_width="50dp"
                android:layout_height="50dp"
                android:layout_gravity="bottom|right"
                android:background="@drawable/camera"/>
        </FrameLayout>

    </RelativeLayout>
</ScrollView>

1 个答案:

答案 0 :(得分:0)

这样做......

<Button
                    android:id="@+id/uploadImage"
                    android:layout_width="50dp"
                    android:layout_height="50dp"
                    android:layout_marginLeft="//define according to your layout"
                    android:layout_marginTop="//define according to your layout"
                    android:layout_toRightOf="@+id/profile_Image"
                    android:background="@drawable/camera" />
相关问题