Reputation: 489
I've created a layout with DiagonalLayout and I want add a circle image like the following picture shows.
My layout code :
<com.github.florent37.diagonallayout.DiagonalLayout
android:background="@color/grey_alt"
android:layout_width="match_parent" android:layout_height="match_parent"
app:diagonal_angle="10" app:diagonal_position="bottom" app:diagonal_direction="right">
<android.support.v7.widget.AppCompatImageView
android:id="@+id/imgBanner"
android:background="@color/grey_bg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@mipmap/ic_launcher"/>
</com.github.florent37.diagonallayout.DiagonalLayout>
and this is the demo image of my layout code
Upvotes: 0
Views: 92
Reputation: 91
try layout_alignEnd
& layout_alignTop
hope this helps you....
<android.support.design.widget.FloatingActionButton
android:id="@+id/floatingActionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="@+id/diagonal_layout"
android:layout_alignTop="@+id/diagonal_layout"
android:layout_marginEnd= as per ur requirement
android:layout_marginTop= as per ur requirement />
Upvotes: 1