惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

美团技术团队
D
DataBreaches.Net
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
D
Docker
N
Netflix TechBlog - Medium
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
Check Point Blog
腾讯CDC
Stack Overflow Blog
Stack Overflow Blog
V
Visual Studio Blog
IT之家
IT之家
月光博客
月光博客
U
Unit 42
K
Kaspersky official blog
T
Threatpost
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
GbyAI
GbyAI
P
Proofpoint News Feed
Last Week in AI
Last Week in AI
云风的 BLOG
云风的 BLOG
酷 壳 – CoolShell
酷 壳 – CoolShell
I
InfoQ
Engineering at Meta
Engineering at Meta
Recorded Future
Recorded Future
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
S
Security @ Cisco Blogs
MyScale Blog
MyScale Blog
大猫的无限游戏
大猫的无限游戏
Security Archives - TechRepublic
Security Archives - TechRepublic
Webroot Blog
Webroot Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Hacker News - Newest:
Hacker News - Newest: "LLM"
S
Schneier on Security
S
Secure Thoughts
The Register - Security
The Register - Security
B
Blog RSS Feed
The Last Watchdog
The Last Watchdog
P
Palo Alto Networks Blog
爱范儿
爱范儿
B
Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
N
News and Events Feed by Topic
阮一峰的网络日志
阮一峰的网络日志
L
LINUX DO - 热门话题
C
Cisco Blogs
Spread Privacy
Spread Privacy
F
Full Disclosure
博客园 - 聂微东
T
The Blog of Author Tim Ferriss

博客园 - 航宇

关于table中使用了colspan后导致列宽度失效问题 Tomcat9 easyui-datagrid中文分页乱码,提示按钮中文乱码解决方法 修复tomcat9.0中文乱码 maven项目中更新了核心库后导致一些包提示未定义,如:The import org.json cannot be resolved js代码突然在花括号回车自动多加了一个大括号 SQL0419N 十进制除法运算无效,因为结果将有一个负小数位。 SQLSTATE=42911 android listview里包含组件(checkbox)点击事件和Item的点击事件冲突 jsp页面的html代码显示不出来,提示Uncaught SyntaxError: Unexpected token < hibernate中怎样配置两个联合属性为唯一约束(非联合主键) maven 在clean package时,出现:找不到符号 [ERROR] 符号: 方法 sqlDdlFilter(java.lang.String) 解决办法 如何实现Activiti的分支条件的自定义配置(转) 生成验证码 给area标签添加红色边框 android shape 怎么在底部画横线 ListView点击事件失效(item里面有button按钮控件)解决方法 [IBM][CLI Driver] SQL0270N 函数不受支持(原因码:"75")。 SQLSTATE=42997 android 可以在程序代码中设置样式:style 基于Zxing的二维码的二维码扫描之横屏扫描 Tomcat Connector的三种运行模式
ScrollView嵌套Linearlayout显示不全的解决办法
航宇 · 2018-06-29 · via 博客园 - 航宇

以为ScrollView只能嵌套一个元素,所以把几个控件都包裹在了一个LinearLayout中了。但是发现底部显示不全,滑动不到最底下。 
代码:

<ScrollView
        android:id="@+id/scrollView"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content">
     <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:background="@color/colorWhite"
            android:orientation="vertical"
            android:padding="15dp">

            <TextView
                android:id="@+id/tv_detail_name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Hibernate注解"
                android:textColor="#262626"/>

            <TextView
                android:id="@+id/tv_detail_description"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="10dp"
                android:ellipsize="end"
                android:maxLines="5"
                android:text="Hibernate注解详细描述"
                android:textSize="12sp"/>
        </LinearLayout>
 </ScrollView>

原因是什么呢? 
其实就是LinearLayout中的

android:layout_marginTop="10dp"

这样,ScrllView在开始显示的时候就会向下移10dp。解决办法有很多种 
1、把android:layout_marginTop=”10dp”加给ScrllView 
2、给Linearlayout再加上两个属性:

     android:paddingTop="10dp"
     android:paddingBottom="8dp"

其实我们还可以直接把ScrllView作为跟布局的,这样就简单很多。

好啦,就是这样。问题不限于嵌套Linearlayout,其他的道理也是一样的。

有问题欢迎提出。

哦对了,欢迎大家加群一起交流,群主是多年开发经验的大牛: