android horizontal scrollview

Hi
am testing horizontal scrollview i came to a strange problem ,i put one button in horizontal scrollview with layout height and width fill_parent but that tag have no effect in layout ,lets look in to my layout

  • Convert GeoPoint to Location
  • Cannot resolve symbol 'support' (using Android Studio, following getting started guide)
  • Is that secure to keep sensitive data in SQLite
  • how to parse JSONArray in android
  • Problem importing Android project archives into Eclipse
  • Universal Image Loader: Can I use cache but also refresh it?
  • <HorizontalScrollView
    android:layout_width="wrap_content"
    android:layout_height="fill_parent"
    android:fillViewport="true"
    >
    
        <LinearLayout
            android:id="@+id/linearLayout1"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
    
            >
            <Button             
                android:text="Button"
                android:id="@+id/button1"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent">
            </Button>
        </LinearLayout>
    
        </HorizontalScrollView>
    

    How can i fill the layout with my button inside horizontal scrollview

    Related posts:

    Add item to ListView without reloading
    Service that runs every minute
    How to set Style for a button in Android?
    How can I enable or disable the GPS programmatically on Android?
    onDestroy gets called each time the screen goes on
    What is phonestateintentreceiver.notifyPhoneCallState used for?
  • Call parent's activity from a fragment
  • TextToSpeech with API 21
  • Android: How to get a custom View's height and width?
  • android - socket timeout while connecting
  • Android FTP Library
  • MultiSelect gesture like Google Photos app
  • 3 Solutions collect form web for “android horizontal scrollview”

    the problem might be in android:width="wrap_content"….
    as u did wrap content for horizontal scrollview and it is parent of linearlayout and button in above case…….
    that might be creating all the problem…
    either hard code size of linear layout or put android:width="fill_parent" in horizontal scroll view…..

    Remember that scroll view layout_height must be warp_content , fill_parent attribute does not affect on the scrollview height, if you want to fill whole screen by button in your layout you should mentioned the layout_height hard coded.

    Put this two tag in HorizontalScrollView

    xmlns:android=”http://schemas.android.com/apk/res/android”
    xmlns:tools=”http://schemas.android.com/tools”

    Put orientation in LinearLayout

    android:orientation=”vertical”

    Do android:layout_height=”fill_parent” to android:layout_height=”wrap_content” in HorizontalScrollView

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.