android-如何让一个布局文件在活动底部,不随着滚动,是顶部和底部不滚动,中间滚动

问题描述

如何让一个布局文件在活动底部,不随着滚动,是顶部和底部不滚动,中间滚动

如何让一个布局文件在活动底部,不随着滚动,是顶部和底部不滚动,中间滚动,

解决方案

在w3chool上有关css有这样的例子

解决方案二:

AmazeUI滚动到底部或者滚动到顶部甚至任意位置
ScrollView滚动到底部和顶部的检测

解决方案三:

中间的控件放到一个 ScrollView 中就可以了、;

解决方案四:

头尾固定,中间放可滚动的控件

解决方案五:

整个页面父布局改成 relativeLayout 里面加一个 在底部或头部控件(定义为 topView)紧贴父布局头部 然后把之前写的(mainView)在below 在topView的下面就行了

解决方案六:

综合采纳,上面几位也提到了,简单点用最外用个相对布局,相对父布局固定头尾布局栏,在中间加滑动控件,像你这问的应该上下滚动吧,就在中间加一个ScrollView就可以啦,注意:ScrollView包裹的直接子布局或控件只能有一个……希望对你有用

解决方案七:

把头部和尾部放在scrollview外面,中间那部分全部用scrollview包起来

解决方案八:

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

    <TextView
        android:text="head"
        android:padding="8dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <ScrollView
        android:layout_width="wrap_content"
        android:layout_height="0dp"
        android:layout_weight="1">

        <LinearLayout
            android:layout_width="match_parent"
            android:orientation="vertical"
            android:layout_height="wrap_content">

            <!-- 加相应的控件 -->

        </LinearLayout>
    </ScrollView>

    <TextView
        android:text="bottom"
        android:padding="8dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

</LinearLayout>

解决方案九:

用 RelativeLayout先将你要固定的两个控件放置顶部和底部,中间用ScrollView,ScrollView里写一个布局,LinearLayout,你想滚动应该是要放ListView之类的控件吧,嗯 就是这样

时间: 2024-08-31 01:07:47

android-如何让一个布局文件在活动底部,不随着滚动,是顶部和底部不滚动,中间滚动的相关文章

设计-Android studio 在XML布局文件中编辑好代码,为什么Design界面创建的控件会重叠?

问题描述 Android studio 在XML布局文件中编辑好代码,为什么Design界面创建的控件会重叠? 新手表示每次都要在Design界面一个一个拖来调整位置,但看教程上并不需要拖.求各位指点~ 解决方案 应该 是因为你在xml并没有排列好控件的布局,重叠很有可能是你把控件都放在了relativelayout里,relativelayout需要手动设置控件的位置 解决方案二: 尽量不要采取拖动方式,使用代码控制会比较好 解决方案三: 默认是相对布局 相对布局的控件式会重叠的

android layout-Android 从外部布局文件初始化控件

问题描述 Android 从外部布局文件初始化控件 需求: 从网络下载一个布局文件,然后解析布局文件,初始化控件. 现在Android只能解析编译后的布局文件,请问对外部的布局文件如何解析? 解决方案 Android XML解析学习--Sax方式:http://blog.csdn.net/ichliebephone/article/details/5965826 Android XML解析学习--Sax方式(续):http://blog.csdn.net/ichliebephone/articl

用 androidstudio 阅读android源码的布局文件 为什么没有预览?求大神解惑;

问题描述 用 androidstudio 阅读android源码的布局文件 为什么没有预览?求大神解惑: RT,用eclipse的时候偶尔还能看到点东西,用androidstudio 连预览界面都不出现 解决方案 两种原因一种是布局有错误 二是没有选对SDK 解决方案二: 不出现就是因为布局输出错误或者导入自定义布局,不执行代码,就不显示自定义布局内容

android scrollview 自动滚动到顶部或者底部的实例

android scrollview 自动滚动到顶部或者底部 摘要: android scrollview 自动滚动到顶部或者底部 android scrollview 自动滚动到顶部或者底部 //设置默认滚动到顶部 scrollView.post(new Runnable() { @Override public void run() { // TODO Auto-generated method stub scrollView.fullScroll(ScrollView.FOCUS_UP);

android中在Layout布局文件中添加控件ID,在Activity中findViewById找不到

        一直用着好好的eclipse开发android的应用,突然新建的项目中发现在Layout布局文件中控件ID在R中不能自动生成了.然后在Eclipse中通过Project->Clean操作之后在R中就生成了控件的ID,这样也太麻烦了.突然想到前几天做个项目需要把eclipse中的自动构建取消掉了,然后目前就不能自动生成了,需要手动操作,在eclipse中设置自动构建就好了,具体操作Project->Build Automatically.在build automatically出

android动态加载布局文件示例_Android

一.布局文件part.xml: 复制代码 代码如下: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="match_parent"    android:layout_height="

android动态加载布局文件示例

一.布局文件part.xml: 复制代码 代码如下:<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="match_parent"    android:layout_height="m

Android Studio 实时显示布局文件Preview窗口

Android Studio的功能包含preview窗口, 可以查看布局(layout)的样式;     位置:app->src->main->res(资源)->layout(布局), 其中的文件, 包含design和text,选择text, 就可以观察到preview窗口;     也可以通过Tool Windows进行设置;     具体位置:view->Tool Windows->Preview

有一个jquery鼠标滚轮垂直滚动的代码 有什么办法可以当内容滚动到顶部或底部不移动鼠标继续滚动页面

问题描述 这个是鼠标滚轮拉动垂直滚动的代码问题是当垂直滚动的时候内容到顶部或底部就停止不继续滚动页面,现在想滚动页面,这个是main.js里的代码要修改哪一段就可以了?jQuery(function($){//-----------------------------------------------------------------------------------//Examples//--------------------------------------------------