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

推荐订阅源

Forbes - Security
Forbes - Security
T
Tailwind CSS Blog
Hugging Face - Blog
Hugging Face - Blog
Blog — PlanetScale
Blog — PlanetScale
WordPress大学
WordPress大学
aimingoo的专栏
aimingoo的专栏
Y
Y Combinator Blog
U
Unit 42
I
InfoQ
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
V
Visual Studio Blog
B
Blog RSS Feed
Vercel News
Vercel News
F
Fortinet All Blogs
Know Your Adversary
Know Your Adversary
T
Troy Hunt's Blog
博客园 - 【当耐特】
MongoDB | Blog
MongoDB | Blog
大猫的无限游戏
大猫的无限游戏
A
About on SuperTechFans
Jina AI
Jina AI
小众软件
小众软件
T
Threatpost
有赞技术团队
有赞技术团队
人人都是产品经理
人人都是产品经理
The Hacker News
The Hacker News
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Microsoft Azure Blog
Microsoft Azure Blog
Recent Announcements
Recent Announcements
酷 壳 – CoolShell
酷 壳 – CoolShell
Scott Helme
Scott Helme
B
Blog
腾讯CDC
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
S
Schneier on Security
N
News and Events Feed by Topic
Microsoft Security Blog
Microsoft Security Blog
K
Kaspersky official blog
G
Google Developers Blog
T
Tor Project blog
PCI Perspectives
PCI Perspectives
S
Secure Thoughts
Google Online Security Blog
Google Online Security Blog
Latest news
Latest news
Google DeepMind News
Google DeepMind News
MyScale Blog
MyScale Blog
罗磊的独立博客

博客园 - 航宇

关于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,其他的道理也是一样的。

有问题欢迎提出。

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