android - Make page that is almost page-height scrollable -
i have page displays bunch of data , has few buttons. pretty static. want make page feel more responsive giving page ability move around. know scroll-up when considering page of data.
i thought surround page scroll view, makes there small blank strip @ bottom of screen (as though wrapping content, have set fill-parent).
anyway, here xml:
<scrollview xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" tools:context=".dealerdetails"> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:background="#ababab"> <linearlayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_gravity="center_horizontal" android:layout_margintop="15dp"> <textview android:id="@+id/name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancelarge" android:textcolor="#ffffff" android:layout_marginleft="15dp" android:layout_gravity="center_vertical" android:text="store" /> <textview android:id="@+id/distance" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancesmall" android:textcolor="#ffffff" android:layout_marginleft="30dp" android:layout_gravity="center_vertical" android:text="2 mi." /> </linearlayout> <linearlayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_margintop="10dp" android:layout_marginleft="15dp"> <imageview android:id="@+id/directionsimage" android:layout_weight="1" android:layout_width="0dip" android:layout_height="wrap_content" android:contentdescription="@string/cd_dealer_location" android:src="@drawable/device_access_location_found" android:layout_marginright="15dp" /> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:layout_gravity="center_vertical"> <textview android:id="@+id/address1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancemedium" android:textcolor="#2b91af" android:text="555 super st. suite 500" /> <textview android:id="@+id/address2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancemedium" android:textcolor="#2b91af" android:text="san antonio, tx 78791" /> </linearlayout> </linearlayout> <linearlayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_margintop="3dp" android:layout_marginleft="15dp"> <imageview android:id="@+id/phoneimage" android:layout_weight="1" android:layout_width="0dip" android:layout_height="wrap_content" android:contentdescription="@string/cd_dealer_phone_number" android:src="@drawable/device_access_call" android:layout_marginright="15dp" /> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:layout_gravity="center_vertical"> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_gravity="center_vertical"> <textview android:id="@+id/address1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancemedium" android:textcolor="#ffffff" android:layout_marginright="10dp" android:text="sales: " /> <textview android:id="@+id/address1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancemedium" android:textcolor="#2b91af" android:text="830-626-5200" /> </linearlayout> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_gravity="center_vertical"> <textview android:id="@+id/address1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancemedium" android:textcolor="#ffffff" android:layout_marginright="10dp" android:text="service: " /> <textview android:id="@+id/address1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancemedium" android:textcolor="#2b91af" android:text="830-661-4511" /> </linearlayout> </linearlayout> </linearlayout> <linearlayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_margintop="3dp" android:layout_marginleft="15dp"> <imageview android:id="@+id/hoursimage" android:layout_weight="1" android:layout_width="0dip" android:layout_height="wrap_content" android:contentdescription="@string/cd_dealer_hours_of_operation" android:src="@drawable/device_access_time" android:layout_marginright="15dp" /> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:layout_gravity="center_vertical"> <textview android:id="@+id/servicehoursheader" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancemedium" android:textcolor="#ffffff" android:layout_marginbottom="1dp" android:text="service hours" /> <textview android:id="@+id/servicehoursdetails1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancesmall" android:textcolor="#232323" android:layout_marginleft="12dp" android:text="monday-friday: 8:00 - 8:00 pm" /> <textview android:id="@+id/servicehoursdetails2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancesmall" android:textcolor="#232323" android:layout_marginleft="12dp" android:text="saturday: 8:00 - 5:00 pm" /> <textview android:id="@+id/servicehoursdetails3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancesmall" android:textcolor="#232323" android:layout_marginleft="12dp" android:text="sunday: closed" /> </linearlayout> </linearlayout> <linearlayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_margintop="3dp" android:layout_marginleft="15dp"> <imageview android:id="@+id/hoursimage" android:layout_weight="1" android:layout_width="0dip" android:layout_height="wrap_content" android:contentdescription="@string/cd_dealer_hours_of_operation" android:src="@drawable/device_access_time" android:layout_marginright="15dp" /> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:layout_gravity="center_vertical"> <textview android:id="@+id/saleshoursheader" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancemedium" android:textcolor="#ffffff" android:layout_marginbottom="1dp" android:text="sales hours" /> <textview android:id="@+id/saleshoursdetails1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancesmall" android:textcolor="#232323" android:layout_marginleft="12dp" android:text="monday-friday: 8:00 - 6:00 pm" /> <textview android:id="@+id/saleshoursdetails2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancesmall" android:textcolor="#232323" android:layout_marginleft="12dp" android:text="saturday: 8:00 - 3:00 pm" /> <textview android:id="@+id/saleshoursdetails3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancesmall" android:textcolor="#232323" android:layout_marginleft="12dp" android:text="sunday: closed" /> </linearlayout> </linearlayout> <linearlayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_margintop="3dp" android:layout_marginleft="15dp"> <imageview android:id="@+id/servicesimage" android:layout_weight="1" android:layout_width="0dip" android:layout_height="wrap_content" android:contentdescription="@string/cd_dealer_services_offered" android:src="@drawable/gear" android:layout_marginright="15dp" /> <linearlayout android:layout_width="241dp" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:orientation="vertical" > <textview android:id="@+id/servicehoursheader" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancemedium" android:textcolor="#ffffff" android:layout_marginbottom="2dp" android:text="services" /> <textview android:id="@+id/servicehoursdetails1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginleft="12dp" android:text="body shop, new heavy duty, used heavy sales, service" android:textappearance="?android:attr/textappearancesmall" android:textcolor="#232323" /> </linearlayout> </linearlayout> <button android:id="@+id/mylocationbutton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_margintop="15dp" android:background="@drawable/dark_button" android:padding="5dp" android:text="@string/view_inventory" android:textcolor="#ffffff" android:onclick="viewinventory" /> </linearlayout> </scrollview>
sorry large block of text, important part outer-most 2 elements.
change first linearlayout
height android:layout_height="match_parent"
edit: okay give go". add first linearlayout
android:fillviewport="true"
Comments
Post a Comment