Home How place overlay imageview on two layouts?
Reply: 0

How place overlay imageview on two layouts?

user2421
1#
user2421 Published in May 27, 2018, 3:38 am

I want to build the following screen which contains app logo, success/failure icon image, information message and ok button.

Here this the code. I am using linear layout to achieve this.

<LinearLayout
android:id="@+id/statusLinearLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:background="@android:color/white"
android:weightSum="2"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout
    android:id="@+id/statusTopRelativeLayout"
    android:background="@android:color/holo_blue_bright"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:orientation="vertical"
    android:layout_weight="1">
    <ImageView
        android:id="@+id/client_logo"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:contentDescription="@string/no_image_description"
        android:src="@drawable/client_logo"
        android:layout_centerVertical="true"
        android:layout_centerHorizontal="true"/>
</RelativeLayout>
<RelativeLayout
    android:id="@+id/statusBottomRelativeLayout"
    android:background="@android:color/holo_blue_light"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="1">
    <TextView
        android:id="@+id/statusText"           
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="50dp"
        android:text="@string/statusText"
        android:textSize="50sp"/>
    <Button
        android:id="@+id/btnOk"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/statusText"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="50dp"            
        android:clickable="true"
        android:focusable="true"
        android:onClick="goToHomeScreen"
        android:paddingBottom="15dp"
        android:paddingTop="15dp"
        android:text="@string/ok"
        android:textColor="#ffffff"
        android:textSize="40sp"/>
</RelativeLayout>

How to place success/failure icon image on top of the two layouts?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.412239 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO