zoukankan      html  css  js  c++  java
  • android实现上下滑动 问答记录

    布局最外包一层滚动条

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
     <ScrollView
            android:id="@+id/scrollView1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" >
     
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical" >
            </LinearLayout>
        </ScrollView>
        强制横竖屏
        在配置文件中对Activity节点添加android:screenOrientation属性(landscape是横向,portrait是纵向)
    追问:
    滑动弄了下是可以成功了,不过是放在第一个layout的下面,放在最外面出错了,

    还有就是锁定横竖屏的没有实现,我的配置文件中原来是没有activity这个节点的,是不是这个节点除了这个属性之外还要什么属性的,是否是放在manifest之下
    追答:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    <activity
                android:name=".MainActivity"
                android:label="@string/app_name" 
                android:screenOrientation = "landscape">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
     
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>

    安卓项目不可能没有activity节点的

  • 相关阅读:
    系统可靠性测试
    系统可靠性的技术设计
    可靠性测试的基础知识——软件可靠性测试
    可靠性测试的基础知识——可靠性的计算方法
    python 中英文时间转换
    Python之日期与时间处理模块(date和datetime)
    使用Python操作Redis
    scrapy操作指南
    爬虫中什么是requests
    面向对象的自我总结
  • 原文地址:https://www.cnblogs.com/tonglingqijie/p/4699594.html
Copyright © 2011-2022 走看看