• 滚动视图练习


    java代码

      1 <?xml version="1.0" encoding="utf-8"?>
      2 <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
      3     android:layout_width="match_parent"
      4     android:layout_height="match_parent"
      5     android:padding="15dp">
      6     <LinearLayout
      7         android:layout_width="match_parent"
      8         android:layout_height="match_parent"
      9         android:orientation="vertical">
     10         <Button
     11             android:id="@+id/btn_1"
     12             android:layout_width="match_parent"
     13             android:layout_height="wrap_content"
     14             android:background="@drawable/bg_btn4"
     15             android:text="翠翠你好"/>
     16   
     17         <Button
     18             android:id="@+id/btn_2"
     19             android:layout_width="match_parent"
     20             android:layout_height="wrap_content"
     21             android:text="点击进入登陆界面"
     22             android:textSize="20sp"
     23             android:textColor="#0066FF" />
     24         <Button
     25             android:id="@+id/btn_3"
     26             android:layout_width="match_parent"
     27             android:layout_height="wrap_content"
     28             android:text="按钮2"
     29             android:drawableRight="@drawable/science"
     30             android:background="@drawable/button_shape"
     31             android:textSize="20sp"
     32             android:textColor="#0066FF"
     33             android:layout_marginTop="20dp"
     34             android:onClick="showToast"
     35             />
     36         <Button
     37             android:id="@+id/btn_4"
     38             android:layout_width="match_parent"
     39             android:layout_height="wrap_content"
     40             android:text="按钮--------------"
     41             android:drawableRight="@drawable/science"
     42             android:background="@drawable/button_shape"
     43             android:textSize="20sp"
     44             android:textColor="#0066FF"
     45             android:layout_marginTop="20dp"
     46             android:onClick="showToast1"
     47             />
     48         <Button
     49             android:id="@+id/btn_zhuce"
     50             android:layout_width="match_parent"
     51             android:layout_height="wrap_content"
     52             android:text="点击进入用户注册界面"
     53             android:textSize="20sp"
     54             android:textColor="#0066FF" />
     55         <Button
     56             android:id="@+id/btn_check"
     57             android:layout_width="match_parent"
     58             android:layout_height="wrap_content"
     59             android:text="check小练习"
     60             android:textSize="20sp"
     61             android:textColor="#0066FF" />
     62         <Button
     63             android:id="@+id/btn_listview"
     64             android:layout_width="match_parent"
     65             android:layout_height="wrap_content"
     66             android:text="listview练习"
     67             android:textSize="20sp"
     68             android:textColor="#0066FF" />
     69         <Button
     70             android:id="@+id/btn_test1"
     71             android:layout_width="match_parent"
     72             android:layout_height="wrap_content"
     73             android:text="test测试1"
     74             android:textSize="20sp"
     75             android:layout_marginTop="250dp"
     76             android:textColor="#0066FF" />
     77         <Button
     78             android:id="@+id/btn_test2"
     79             android:layout_width="match_parent"
     80             android:layout_height="wrap_content"
     81             android:text="test测试2"
     82             android:textSize="20sp"
     83             android:textColor="#0066FF" />
     84         <HorizontalScrollView
     85             android:layout_width="match_parent"
     86             android:layout_height="match_parent">
     87             <LinearLayout
     88                 android:layout_width="wrap_content"
     89                 android:layout_height="wrap_content"
     90                 android:orientation="horizontal">
     91                 <Button
     92                     android:id="@+id/btn_test3"
     93                     android:layout_width="match_parent"
     94                     android:layout_height="match_parent"
     95                     android:text="test测试3"
     96                     android:textSize="20sp"
     97                     android:textColor="#0066FF" />
     98                 <Button
     99                     android:id="@+id/btn_test4"
    100                     android:layout_width="match_parent"
    101                     android:layout_height="match_parent"
    102                     android:text="test测试4"
    103                     android:textSize="20sp"
    104                     android:textColor="#0066FF" />
    105                 <Button
    106                     android:id="@+id/btn_test5"
    107                     android:layout_width="match_parent"
    108                     android:layout_height="match_parent"
    109                     android:text="test测试5"
    110                     android:textSize="20sp"
    111                     android:textColor="#0066FF" />
    112                 <Button
    113                     android:id="@+id/btn_test6"
    114                     android:layout_width="match_parent"
    115                     android:layout_height="match_parent"
    116                     android:text="test测试6"
    117                     android:textSize="20sp"
    118                     android:textColor="#0066FF" />
    119             </LinearLayout>
    120   
    121         </HorizontalScrollView>
    122   
    123   
    124   
    125   
    126   
    127     </LinearLayout>
    128   
    129   
    130   
    131 </ScrollView>
  • 相关阅读:
    Windows 服务的安装(1)
    C#编写window服务,一步一步(1)
    .net 读写记事本文件
    C#中POST数据和接收的几种方式(抛砖引玉)
    Newtonsoft.Json 通过 JObject 读取 json对像 超简单
    Winform读写App.config文件以及重启程序
    WebMatrix之WebMatrix.Data
    C#中方法的参数的四种类型
    zh-Hans vs.net 通过 管理nuget程序包下载简体中文语言包 zh-cn
    .net C# 图片转Base64 Base64转图片
  • 原文地址:https://www.cnblogs.com/reddead/p/14163979.html
Copyright © 2020-2023  润新知