Since the new project needs to support the 2.3.3 version of the Android model, the amount, 2.3.3 or so has a very very small share,
Also need support, the real egg hurts.
<relativelayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:tools= "http// Schemas.android.com/tools "xmlns:app=" Http://schemas.android.com/apk/res-auto "android:layout_width=" Match_ Parent "android:layout_height=" match_parent "android:paddingbottom=" @dimen/activity_vertical_margin "Android:padd ingleft= "@dimen/activity_horizontal_margin" android:paddingright= "@dimen/activity_horizontal_margin" Android: paddingtop= "@dimen/activity_vertical_margin" tools:context= ". Mainactivity "> <android.support.v4.widget.swiperefreshlayout android:layout_width=" match_parent "an droid:layout_height= "Wrap_content" > <textview android:layout_width= "match_parent" Andro id:layout_height= "Wrap_content" android:text= "@string/hello_world"/> </android.support.v4.widget.swip erefreshlayout> <android.support.design.widget.floatingactionbutton app:backgroundtint= "#ff87ffeb" app:elevation= "6DP" app:pressedtranslationz= "12DP" app:ripplecolor= "#33728dff" Android:layout_widt H= "Wrap_content" android:layout_height= "wrap_content" android:layout_gravity= "Right|bottom" android:s rc= "@mipmap/ic_launcher"/></relativelayout>
The effect of the emulator version for 2.3.7 is still good on genymotion.
Then try the effect of CardView on the 2.3.7:
<relativelayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:app= "http// Schemas.android.com/apk/res-auto "xmlns:tools=" Http://schemas.android.com/tools "android:layout_width=" Match_ Parent "android:layout_height=" match_parent "android:paddingbottom=" @dimen/activity_vertical_margin "Android:padd ingleft= "@dimen/activity_horizontal_margin" android:paddingright= "@dimen/activity_horizontal_margin" Android: paddingtop= "@dimen/activity_vertical_margin" tools:context= ". Mainactivity "> <android.support.v7.widget.cardview android:id=" @+id/cardview "android:layout_width= "Match_parent" android:layout_height= "80DP" android:layout_margin= "8DP" app:cardbackgroundcolor= "@col Or/white "app:cardcornerradius=" 8DP "> <textview android:layout_width=" match_parent " android:layout_height= "Wrap_content" android:text= "@string/hello_world"/> </android.support.v7. Widgets. Cardview></relativelayout>
You can see that you can set the background color of the CardView and the size of the fillet.
App:cardbackgroundcolor= "@color/white" app:cardcornerradius= "8DP"
You can also see that the shadow effect here is not required to be set. In fact, CardView is inherited from the framelayout, so use can be used as a framelayout to use.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Use Android.support.v4.widget.SwipeRefreshLayout and android.support.design on Android2.3.3 or minsdkversion 10