Use Android.support.v4.widget.SwipeRefreshLayout and android.support.design on Android2.3.3 or minsdkversion 10

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.