-4

My app works well on my android phone but not in older version of android...

Here is my app looks like running from my phone

enter image description here

it seems no problem there but when my app uses an older version of Android, this is the result.

enter image description here

My .xml

<?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"
    xmlns:tools="http://schemas.android.com/tools"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <com.github.ksoichiro.android.observablescrollview.ObservableScrollView
        android:id="@+id/scroll"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fillViewport="true"
        android:layout_above="@+id/mediaplayerlayout"
        android:layout_alignParentTop="true">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <ImageView
                android:id="@+id/image"
                android:layout_width="wrap_content"
                android:layout_height="180dp"
                android:scaleType="centerCrop"
                android:src="@drawable/example"
                tools:ignore="ContentDescription" />
            <TextView
                android:id="@+id/v_title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignLeft="@id/image"
                android:layout_alignTop="@id/image"
                android:layout_alignRight="@id/image"
                android:layout_alignBottom="@id/image"
                android:layout_margin="1dp"
                android:textSize="18dp"
                android:textColor="#FFFFFF"
                android:gravity="center"
                android:text="THIS IS THE TITLE OF SONGS"
                />

            <View
                android:id="@+id/anchor"
                android:layout_width="match_parent"
                android:layout_height="180dp"
                android:minHeight="180dp" />

            <TextView
                android:id="@+id/body"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/anchor"
                android:background="@android:color/white"
                android:paddingBottom="@dimen/activity_vertical_margin"
                android:paddingLeft="@dimen/activity_horizontal_margin"
                android:paddingRight="@dimen/activity_horizontal_margin"
                android:paddingTop="@dimen/activity_vertical_margin"
                />




        </RelativeLayout>

    </com.github.ksoichiro.android.observablescrollview.ObservableScrollView>

    <include layout="@layout/gradient_header"
        android:id="@+id/include" />

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?attr/colorPrimary"
        android:minHeight="?attr/actionBarSize"
        app:popupTheme="@style/Theme.AppCompat.Light.DarkActionBar"
        app:theme="@style/Toolbar"/>

    // ... Other layout here that not included 
</RelativeLayout>

How can I fix this problem that will works both higher and older version of android?

Rob
  • 2,243
  • 4
  • 29
  • 40
basaya
  • 126
  • 1
  • 4
  • 13

1 Answers1

0

when you build a project just choose the lowest android then it will work on both

sourabh kaushik
  • 523
  • 4
  • 20