I would like to create this kind of layout you see in the picture and I'm thinking like negative margin in CSS and no result. Please help me achieve it.
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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="match_parent"
android:layout_height="match_parent"
tools:context=".HomeActivity">
<TextView
android:id="@+id/txt_home_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/box"
android:elegantTextHeight="true"
android:padding="30dp"
android:text="Welcome!"
android:textColor="#ffffff"
android:textSize="28sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp">
<ImageView
android:id="@+id/home_logo"
android:layout_width="90dp"
android:layout_height="80dp"
android:scaleType="fitCenter"
android:src="@drawable/mylogo" />
</FrameLayout>
</android.support.constraint.ConstraintLayout>
Here is the box:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="#2d3669"></solid>
<corners android:radius="50dp"></corners>
<gradient android:angle="90"
android:startColor="#392800"
android:endColor="#faae03"/>
</shape>
</item>
</selector>
I know in ConstraintLayout
how to have items near each other, but I can't figure it out how to put a log on a TextView
so that half of it remains outside! I can't find a keyword that leads to such examples on Google.