Android - ImageView

时间:2016-06-03 11:32:59

标签: android imageview android-linearlayout selector

That's how I want it to be

这是头像图片部分的片段:

<FrameLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal">

                <com.test.testtwo.customview.CustomFontView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:text="@string/str_edit"
                    android:id="@+id/txtEditAvatar"
                    android:drawablePadding="5dp"
                    android:drawableLeft="@mipmap/icon_edit"
                    android:layout_marginLeft="5dp"
                    android:layout_gravity="bottom|right" />

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_gravity="center_horizontal|top">

                    <com.test.testtwwo.customview.RoundedImageView
                        android:layout_width="100dp"
                        android:layout_height="100dp"
                        android:id="@+id/imgAvatar"
                        android:src="@mipmap/placeholder_user"
                        app:oval="true"
                        app:border_color="@color/white"
                        app:border_width="2dp"
                        android:layout_gravity="center_horizontal"
                        android:layout_marginLeft="30dp"
                        android:layout_marginRight="30dp"
                        android:scaleType="centerCrop"/>
                </RelativeLayout>

                <LinearLayout
                    android:orientation="vertical"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="bottom"
                    android:background="@color/action_button_text">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="match_parent"
                        android:textAppearance="?android:attr/textAppearanceMedium"
                        android:text="Alterar"
                        android:id="@+id/tvAlterar"
                        android:layout_gravity="bottom|center_horizontal"
                        android:gravity="bottom"
                        android:layout_marginBottom="8dp" />
                </LinearLayout>

            </FrameLayout>

现在它看起来如何: 我必须在这个圆形的ImageView中适应这种线性布局,但我不知道如何&#34; Image here

提前致谢。

0 个答案:

没有答案