Android Development Notes ___ scrolling views __scroll view

Source: Internet
Author: User

1 <?XML version= "1.0" encoding= "Utf-8"?>2 <LinearLayoutxmlns:android= "Http://schemas.android.com/apk/res/android"3 android:orientation= "vertical"Android:layout_width= "Match_parent"4 Android:layout_height= "Match_parent">5 6     <TextView7         Android:layout_width= "Wrap_content"8 Android:layout_height= "Wrap_content"9 Android:text= "Demo effect"Ten Android:textcolor= "@color/text_color" One android:textsize= "25SP" A android:layout_gravity= "Center"/> -  -     <LinearLayout the         Android:layout_width= "Match_parent" - Android:layout_height= "200DP"> -  -         <Horizontalscrollview +             Android:layout_width= "Wrap_content" - Android:layout_height= "Match_parent"> +  A             <LinearLayout at                 Android:layout_width= "Wrap_content" - Android:layout_height= "Match_parent"> -  -                 <View -                     Android:layout_width= "400DP" - Android:background= "#aaffff" in Android:layout_height= "Match_parent"/> -  to                 <View +                     Android:layout_width= "400DP" - Android:layout_height= "Match_parent" the Android:background= "#ffff00"/> *  $             </LinearLayout>Panax Notoginseng         </Horizontalscrollview> -  the     </LinearLayout> +  A     <ScrollView the         Android:fillviewport= "true" + Android:layout_width= "Match_parent" - Android:layout_height= "Wrap_content"> $  $         <LinearLayout -             Android:layout_width= "Match_parent" - android:orientation= "vertical" the Android:layout_height= "Wrap_content"> - Wuyi             <View the                 Android:layout_width= "Match_parent" - Android:background= "#aa5511" Wu Android:layout_height= "400DP"/> -  About             <View $                 Android:layout_width= "Match_parent" - Android:layout_height= "400DP" - Android:background= "#ffff00"/> -  A             <TextView +                 Android:layout_width= "Match_parent" the Android:layout_height= "Wrap_content" - Android:text= "The use of ScrollView, there are two kinds." \ n vertical direction, horizontal direction. \ n The view can only be placed in one layout "/> $  the         </LinearLayout> the  the     </ScrollView> the  - </LinearLayout>

Java

1  PackageCom.example.alimjan.hello_world;2 3 Importandroid.app.Activity;4 ImportAndroid.content.Context;5 Importandroid.content.Intent;6 ImportAndroid.os.Bundle;7 Importandroid.support.annotation.Nullable;8 9 /**Ten * Created by Alimjan on 6/30/2017. One  */ A  -  Public classClass__2_2_3extendsActivity { - @Override the     protected voidonCreate (@Nullable Bundle savedinstancestate) { -         Super. OnCreate (savedinstancestate); - Setcontentview (r.layout.code_2_2_3); -     } +  -      Public Static voidstarthome (Context mcontext) { +Intent Intent =NewIntent (Mcontext, Class__2_2_3.class); A mcontext.startactivity (intent); at     } -}

Android Development Notes ___ scrolling views __scroll view

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.