gpt4 book ai didi

android - 如何在 android 布局的边框上设置我的 circleImageView?

转载 作者:行者123 更新时间:2023-11-29 17:20:05 25 4
gpt4 key购买 nike

解释: 我想在我的布局边框上设置我的 circleImageView。

这是我的 xml 文件,其中有更多布局,但我想在布局的边框上设置 circleimageview。

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
tools:context="com.angelnx.angelnx.holidays.Registration">


<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_margin="25dp">

<ScrollView
android:fillViewport="true"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<RelativeLayout
android:id="@+id/viewA"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.8"
android:background="@color/login_header"
android:orientation="vertical">

<ImageView
android:id="@+id/symbol"
android:contentDescription="@null"
android:layout_width="fill_parent"
android:layout_height="100dp"
android:layout_gravity="center"
android:src="@drawable/ic_menu_camera"/>

<TextView
android:layout_width="fill_parent"
android:layout_height="75dp"
android:text="@string/Holiday"
android:layout_marginTop="50dp"
android:layout_gravity="center_horizontal|bottom"
android:gravity="center"
android:layout_alignBottom="@+id/symbol"
android:textColor="@color/header_text"
android:textStyle="bold"
android:textSize="20sp"/>

<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/circleView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/circularimage"/>

</RelativeLayout>

<LinearLayout
android:id="@+id/viewB"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:background="@color/fab_tint"
android:layout_weight="1"
android:orientation="vertical">

<FrameLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">

<ImageView
android:contentDescription="@null"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:src="@drawable/ic_username"/>

<android.support.design.widget.TextInputLayout
android:id="@+id/input_layout_name"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<EditText
android:id="@+id/input_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:inputType="text"
android:paddingLeft="30dp"
android:hint="@string/hint_name" />
</android.support.design.widget.TextInputLayout>
</FrameLayout>

<FrameLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">

<ImageView
android:contentDescription="@null"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:src="@drawable/ic_email" />

<android.support.design.widget.TextInputLayout
android:id="@+id/input_layout_email"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<EditText
android:id="@+id/input_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:inputType="textEmailAddress"
android:paddingLeft="30dp"
android:hint="@string/hint_email" />
</android.support.design.widget.TextInputLayout>
</FrameLayout>

<FrameLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">

<ImageView
android:contentDescription="@null"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:src="@drawable/lock_open" />

<android.support.design.widget.TextInputLayout
android:id="@+id/input_layout_password"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<EditText
android:id="@+id/input_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:inputType="textPassword"
android:paddingLeft="30dp"
android:hint="@string/hint_password" />
</android.support.design.widget.TextInputLayout>
</FrameLayout>
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">

<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/btn_select"
android:textAllCaps="false"
android:textSize="17sp"
android:background="@color/btn_start_color"
android:textColor="@color/text_white"/>

</FrameLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="bottom"
android:orientation="horizontal"
android:layout_margin="10dp">

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<Button
android:id="@+id/btn_signup"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/btn_signup"
android:layout_weight="0.7"
android:background="@drawable/button_round"
android:textColor="@android:color/white"/>

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
</LinearLayout>

这是我想要的演示图片

enter image description here

请帮我解决一下

最佳答案

尝试下面的代码:

<?xml version="1.0" encoding="utf-8"?><?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="15dp"
android:orientation="vertical"
tools:context="com.angelnx.angelnx.holidays.Registration">

<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true">

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

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

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

<ImageView
android:id="@+id/symbol"
android:layout_width="fill_parent"
android:layout_height="170dp"
android:scaleType="fitXY"
android:src="@drawable/ic_menu_camera" />
</RelativeLayout>

<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/HomeFragmentProfileImageView"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="85dp"
android:src="@drawable/circularImage" />

<TextView
android:id="@+id/ProjectNameTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/HomeFragmentProfileImageView"
android:layout_centerHorizontal="true"
android:text="Profile"
android:textColor="#000000"
android:textSize="18sp"
android:textStyle="bold" />
</RelativeLayout>

<LinearLayout
android:id="@+id/viewB"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="@color/fab_tint"
android:orientation="vertical">

<FrameLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:contentDescription="@null"
android:src="@drawable/ic_username" />

<android.support.design.widget.TextInputLayout
android:id="@+id/input_layout_name"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<EditText
android:id="@+id/input_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/hint_name"
android:inputType="text"
android:paddingLeft="30dp"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
</FrameLayout>

<FrameLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:contentDescription="@null"
android:src="@drawable/ic_email" />

<android.support.design.widget.TextInputLayout
android:id="@+id/input_layout_email"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<EditText
android:id="@+id/input_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/hint_email"
android:inputType="textEmailAddress"
android:paddingLeft="30dp"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
</FrameLayout>

<FrameLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:contentDescription="@null"
android:src="@drawable/lock_open" />

<android.support.design.widget.TextInputLayout
android:id="@+id/input_layout_password"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<EditText
android:id="@+id/input_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/hint_password"
android:inputType="textPassword"
android:paddingLeft="30dp"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
</FrameLayout>

<FrameLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">

<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/btn_start_color"
android:text="@string/btn_select"
android:textAllCaps="false"
android:textColor="@color/text_white"
android:textSize="17sp" />

</FrameLayout>

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="10dp"
android:gravity="bottom"
android:orientation="horizontal">

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />

<Button
android:id="@+id/btn_signup"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.7"
android:background="@drawable/button_round"
android:text="@string/btn_signup"
android:textColor="@android:color/white" />

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>

关于android - 如何在 android 布局的边框上设置我的 circleImageView?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37001170/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com