1

There are some linear layout inside scrollview as well. when i install the app on HUAWEI Mate7 it works just fine. but on Samsung S3 or LG G3 the only thing that shows is background image but when i touch the screen, methods are working. only views are not showing. here is mainActivity.xml

<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/back1" android:alpha=".9"> <ScrollView android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/scrollView" android:fillViewport="true" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_alignParentStart="true" android:layout_alignParentTop="true" > <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content" android:alpha=".9" android:gravity="center"> </LinearLayout> </ScrollView> </RelativeLayout> 

inside the linear layout there are 20 of this

 <LinearLayout android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="100dp" android:layout_marginBottom="5dp" android:layout_marginTop="5dp" > <ImageButton android:layout_width="0dp" android:layout_height="fill_parent" android:id="@+id/imageButton7" android:src="@drawable/can_pot_com" android:scaleType="fitStart" android:background="#00ffffff" android:cropToPadding="false" android:foregroundGravity="bottom" android:layout_weight="2" /> <Button android:layout_width="0dp" android:layout_height="match_parent" android:textAppearance="?android:attr/textAppearanceLarge" android:text="@string/can_pot" android:id="@+id/button6" android:textStyle="bold" android:textIsSelectable="false" android:lines="3" android:linksClickable="false" android:textColor="#000000" android:background="#00ffffff" android:layout_weight="3" /> </LinearLayout> 

I don't know what do to!

9
  • post your full xml file here... Commented Feb 24, 2016 at 8:40
  • why are you adding xmlns:android="schemas.android.com/apk/res/android" in your ScrollView Commented Feb 24, 2016 at 8:42
  • full xml is more than 30000 character and its not alowed here. @BajiraoShinde Commented Feb 24, 2016 at 8:53
  • look my bellow answer Commented Feb 24, 2016 at 8:54
  • iv read somewhere that it fixes it but it didn't @Prakhar Commented Feb 24, 2016 at 8:54

4 Answers 4

1

The problem is related probably with the align and gravity of the layouts; in the LinearLayout child inside the ScrollView, change the android:gravity="center by: android:gravity="top|center". Hope it helps.

(And and although it does not give you an error, you can remove the second xmlns:android="http://schemas.android.com/apk/res/android")

Sign up to request clarification or add additional context in comments.

Comments

1

I had a similar problem. The LinearLayout inside my ScrollView was not working as expected. The first component of the lineaLayout was not visible. The reason was android:layout_gravity="center_vertical". Change that to android:layout_gravity="top|center_vertical".

Comments

0

try this code

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/back1" android:alpha=".9"> <ScrollView android:layout_width="fill_parent" android:layout_height="match_parent" android:id="@+id/scrollView" android:fillViewport="true" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_alignParentStart="true" android:layout_alignParentTop="true" > <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:alpha=".9" android:gravity="center"> </LinearLayout> </ScrollView> 

Comments

0

remove this line from your scrollview

 xmlns:android="http://schemas.android.com/apk/res/android" 

1 Comment

make sure scrollview contain only one child

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.