随记1——FramLayout先放置Button,再放置TextView,Button会覆盖TextView
来源:互联网 发布:搜索引擎客户数据分析 编辑:程序博客网 时间:2024/06/09 15:24
女神镇楼
前言:随记系列是记录渣渣在开发过程中遇到的问题和感悟等。
我的编码方式
前几天在“一把梭”的时候,发现一个问题,在FramLayout中先放置一个Button,再放置一个TextView,结果Button把TextView覆盖了。
<?xml version="1.0" encoding="utf-8"?><FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:textColor="#ffffff" android:text="这是一个Button" android:textSize="40sp" android:background="#00ff00"/> <TextView android:layout_width="match_parent" android:layout_height="match_parent" android:textColor="#000000" android:text="这是一个TextView" android:textSize="40sp" android:gravity="center" android:background="#ff00ff"/></FrameLayout>
显示情况如下:
很明显,理论上TextView应该在Button上层,但是TextView却没有覆盖住Button。原因是啥,我不知道。但是,给Button加上android:enable="false",这时问题就解决了。如下:
你没看错,这次的内容就是这样。下周再看妹子。
0 0
- 随记1——FramLayout先放置Button,再放置TextView,Button会覆盖TextView
- TextView、Button、EditText
- Android LlistView +Button +TextView
- android组件 TextView Button
- TextView 和 Button
- TextView EditText和Button
- 1.TextView、EditText、Button
- Button和TextView
- TextView vs Button
- Gallery 中放置button 点击事件处理
- 导航栏上的 barbutton放置button
- xml designe 在底部放置一个Button
- 后面的TextView覆盖住前面的Button
- 布局里放置多个TextView控件
- Android控件——TextView、EditText、ImageView、Button、ImageButton
- android实战——监听TextView文本Button改变状态
- OPhone/Android的学习(1)—初步知识,TextView,Button,Layout及事件响应
- Android学习--TextView和Button
- Swift: ImplicitlyUnwrappedOptional,Optional
- Pandas入门(上)
- Retrofit2学习记录
- 如何阅读文献(三)
- StringBuffer和StringBuilder
- 随记1——FramLayout先放置Button,再放置TextView,Button会覆盖TextView
- leetcode【第三周】:输出圆括号
- GitHub使用教程
- 超越spark性能300倍的性能测试
- Maximum Subarray
- 深入理解pthread_cond_wait、pthread_cond_signal
- leetcode No234. Palindrome Linked List
- 表单:单选框与隐藏域
- 设计模式——责任链模式