<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/linearLayout"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:background="@color/background_color">
<TextView android:id="@+id/titleTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/quiz_title"
android:layout_marginBottom="2dp"
android:textSize="@dimen/title_size"
android:textColor="@color/text_color"
android:gravity="center">
</TextView>
<TextView android:id="@+id/questionNumberTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_marginTop="2dp"
android:textColor="@color/text_color"
android:textSize="@dimen/text_size"
android:layout_gravity="center"
android:gravity="center"></TextView>
<ScrollView android:id="@+id/SlotScrollView"
android:layout_width="match_parent"
android:padding="0dp">
<ImageView android:id="@+id/flagImageView"
android:adjustViewBounds="false"
android:layout_width="match_parent"
android:layout_height="@dimen/flag_height">
</ImageView>
<ScrollView
<TextView android:id="@+id/guessCountryTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_marginTop="2dp"
android:text="@string/choose_answer"
android:textColor="@color/text_color"
android:textSize="@dimen/text_size"></TextView>
<TableLayout android:id="@+id/buttonTableLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:stretchColumns="0,1,2,3">
<TableRow android:id="@+id/tableRow0"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"></TableRow>
<TableRow android:id="@+id/tableRow1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"></TableRow>
<TableRow android:id="@+id/tableRow2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"></TableRow>
</TableLayout>
<TextView android:id="@+id/answerTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="@dimen/answer_size"
android:layout_gravity="center"
android:textStyle="bold"
android:gravity="center"></TextView>
</LinearLayout>
I would just like to maximize the imageview such that
1. when the image width is smaller than the screen width, the image would scale up and maximize same as the screen width
2. if the image height is greater than the available space, a scrolling effect would take place for up and down
3. those guessCountryTextView and all components under the image must be shown and to be placed at bottom of the screen.
However, when i add the scrollview just like in the above code, the scrollview occupies the whole screen starting from the imageview and those undernearth like guessCountryTextView all disappears.
How could this be amended? Many thanks!
Try using relativelayout instead of linear layout. use match_parent widht and fixed height for the scrollview thats all u need to do i think… have look at the code u will have to make few adjustments though.