0

I'm new to android studio and to developing a native android application. No i've done my splashscreen for the application. but i'm using "dp" attribute for positioning and sizing. But when i run the application on different screens(i.e phone vs tablet). there was an attribute marginTop that i set with 400dp but the element's position is different on the phone rather than the tablet.

What's the correct form to use when positioning and resizing??.. isn't dp supposed to handle this?!

here's my code

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#181c2c">

<ImageView
    android:id="@+id/splash_logo"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/logo"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="19dp" />

<com.wang.avi.AVLoadingIndicatorView
    android:id="@+id/avi"
    android:scaleX="1.5"
    android:scaleY="1.5"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="340dp"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    style="@style/AVLoadingIndicatorView"
    android:visibility="visible"
    app:indicatorName="BallPulseIndicator"
    app:indicatorColor="#1ed760"
/>

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Omar El-elamy
  • 125
  • 2
  • 6
  • 15

0 Answers0