Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
match_parent like view inside wrap_content RelativeLayout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<ImageView
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_alignBottom="@id/linear_layout"
android:layout_alignEnd="@id/linear_layout"
android:layout_alignStart="@id/linear_layout"
android:layout_alignTop="@+id/linear_layout"
android:src="@android:color/darker_gray"
/>
<LinearLayout
android:id="@id/linear_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clipToPadding="true"
android:orientation="vertical"
>
<ImageView
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_margin="60dp"
android:src="@android:color/holo_blue_bright"
/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.