Mainactivity as follows:
Package Cn.com.bravesoft.testlistviewloadmore;import Java.util.arraylist;import Java.util.hashmap;import Android.app.activity;import Android.os.bundle;import Android.widget.listview;import Android.widget.SimpleAdapter /** * Demo Description: * Example of use of Android:cliptopadding property in ListView or GridView * Explanation of this property: * Defines whether the ViewGroup would clip its Drawing surface so-exclude the padding area. * What does that mean? * The Cliptopadding property defines whether ViewGroup is allowed to be drawn in padding, which defaults to true, which is not allowed. * So if we set the ListView to Android:paddingtop= "70dip" android:paddingbottom= "70dip" * Then we can see that the top of the ListView and the tail below all occupy 70 size padding, in the process of sliding the ListView * This padding of course exists. In the padding section, the ListView item is not visible, Essentially in these two parts are not drawn * Our ListView * If we now set the property for the ListView android:cliptopadding= "false", again slide the ListView at this time can * Found in the ListView above the head and below the tail of the 70 size of the padding section can still show our ListView * Item, essentially in these two parts draw our ListView * * This property is suitable for the application scenario: * Sets the first (last) item of the ListView to a distance from the screen top (BOTTOM) * * Reference: * http://www.cnblogs.com/xitang/p/3606578.html * Thank you V ery much */public class Mainactivity extends Activity {private ListView mlistview;private simpleadapter msimpleadapter;private hashmap< String, object> mhashmap;private arraylist
Main.xml as follows:
<relativelayout 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 " > <listview android:id= "@+id/listview" android:layout_width= "fill_parent" android:layout _height= "Fill_parent" android:layout_centerinparent= "true" android:cliptopadding= "false" Android :p addingtop= "70dip" android:paddingbottom= "70dip" android:background= "@android: Color/darker_gray" android:cachecolorhint= "#00000000" /></relativelayout>