一区二区日本_久久久久久久国产精品_无码国模国产在线观看_久久99深爱久久99精品_亚洲一区二区三区四区五区午夜_日本在线观看一区二区

Android HorizontalScrollView含代碼

Android HorizontalScrollView

一個 HorizontalScrollView 是一個FrameLayout。愛掏網(wǎng) - it200.com android.widget.HorizontalScrollView 類提供了水平滾動視圖的功能。愛掏網(wǎng) - it200.comHorizontalScrollView用于以水平方向滾動子元素或視圖。愛掏網(wǎng) - it200.comHorizontalScrollView只支持水平滾動。愛掏網(wǎng) - it200.com

在垂直滾動方面,Android使用ScrollView。愛掏網(wǎng) - it200.com

讓我們來實(shí)現(xiàn)一個簡單的 HorizontalScrollView 的例子。愛掏網(wǎng) - it200.com

activity_main.xml

現(xiàn)在,從工具欄中拖動一個HorizontalScrollView到activity_main.xml文件中,并在其中放置一些視圖或元素。愛掏網(wǎng) - it200.com

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">


    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:text="Horizontal ScrollView Example"
        android:id="@+id/textView"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true" />


    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="25dp">
        <HorizontalScrollView
            android:layout_width="match_parent"
            android:layout_height="60dp"
            android:id="@+id/horizontalScrollView">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="horizontal">
                <Button
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="New Button1"
                    android:id="@+id/button1" />
                <Button
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="New Button2"
                    android:id="@+id/button2" />

                <Button
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="New Button3"
                    android:id="@+id/button3" />
                <Button
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="New Button4"
                    android:id="@+id/button4" />
                <Button
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="New Button5"
                    android:id="@+id/button5" />
                <Button
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="New Button6"
                    android:id="@+id/button6" />
                <Button
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="New Button7"
                    android:id="@+id/button7" />
                <Button
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="New Button8"
                    android:id="@+id/button8"/>
            </LinearLayout>

        </HorizontalScrollView>
    </LinearLayout>
</RelativeLayout>

Activity類

這是自動生成的代碼,我們沒有在這里編寫任何代碼。愛掏網(wǎng) - it200.com

文件:MainActivity.java

package com.example.test.horizantalscrollview;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
}

聲明:所有內(nèi)容來自互聯(lián)網(wǎng)搜索結(jié)果,不保證100%準(zhǔn)確性,僅供參考。如若本站內(nèi)容侵犯了原著者的合法權(quán)益,可聯(lián)系我們進(jìn)行處理。
發(fā)表評論
更多 網(wǎng)友評論0 條評論)
暫無評論

返回頂部

主站蜘蛛池模板: 国产成人免费视频网站高清观看视频 | 91麻豆精品国产91久久久更新资源速度超快 | 国产午夜精品一区二区三区在线观看 | 欧美日韩大片 | 久草网免费 | 99re热精品视频| 在线国产一区 | 国产婷婷综合 | 五月婷婷视频 | 成人高清网站 | 日韩一及片 | 在线中文字幕亚洲 | 在线免费亚洲视频 | 在线一级片 | 国产福利91精品 | 免费在线观看成人av | 亚洲最大福利网 | 97视频网站| 欧美日韩国产三级 | 91中文字幕在线 | 福利视频亚洲 | 黄色一级大片在线免费看产 | 欧美a∨| 国产乱码久久久久久 | 日韩免费| 国产在线精品免费 | 久久这里有精品 | 亚洲一区二区三区四区五区中文 | 亚洲www啪成人一区二区麻豆 | 欧美最猛性xxxxx亚洲精品 | 草草视频在线观看 | 欧美日韩在线精品 | 日韩精品成人一区二区三区视频 | 久久久久久艹 | 亚洲精品二区 | 午夜精品久久久久久久星辰影院 | 久久综合av | 神马久久香蕉 | 欧美一区二区 | 在线一区视频 | 五月天婷婷激情 |