android之layout_toLeftOf和layout_toRightOf出现的错误
来源:互联网 发布:php小项目源码 编辑:程序博客网 时间:2024/06/06 01:20
错误是这样的,布局文件如下,总是在SeekBar里面的这一句android:layout_toLeftOf="@id/voice_max"报错,差点气得我吐血,明明没有错误的.
后来我尝试作了修改,如下
错误就消失了,原来toLeftOf和toRightOf的参数需要在使用它们之前定义,
刚开始只想着从左到右的顺序挨个写,显得有条理,看来我想多了.
错误就消失了,
<ImageView android:id="@+id/voice_min" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_centerVertical="true" android:background="@drawable/voice_min"/><SeekBar android:id="@+id/sb_voice" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_centerVertical="true" android:layout_toLeftOf="@id/voice_max" android:layout_toRightOf="@id/voice_min" android:paddingLeft="5dp" android:paddingRight="5dp" android:background="@drawable/voice_seekbar_bg" /><ImageView android:id="@+id/voice_max" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_alignParentRight="true" android:layout_centerVertical="true" android:background="@drawable/voice_max"/>
后来我尝试作了修改,如下
<ImageView android:id="@+id/voice_min" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_centerVertical="true" android:background="@drawable/voice_min"/> <ImageView android:id="@+id/voice_max" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_alignParentRight="true"android:layout_centerVertical="true" android:background="@drawable/voice_max"/> <SeekBar android:id="@+id/sb_voice" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_centerVertical="true" android:layout_toLeftOf="@id/voice_max" android:layout_toRightOf="@id/voice_min" android:paddingLeft="5dp" android:paddingRight="5dp" android:background="@drawable/voice_seekbar_bg" />
错误就消失了,原来toLeftOf和toRightOf的参数需要在使用它们之前定义,
刚开始只想着从左到右的顺序挨个写,显得有条理,看来我想多了.
错误就消失了,
0 0
- android之layout_toLeftOf和layout_toRightOf出现的错误
- android之layout_toLeftOf和layout_toRightOf出现的错误
- android之layout_toLeftOf和layout_toRightOf出现的错误
- 在代码中设置RelativeLayout布局中标签的android:layout_toLeftOf、android:layout_toRightOf等属性
- Android (layout_toLeftOf,layout_toRightOf,layout_above,layout_below) 使用注意点
- android属性layout_toRightOf和layout_toEndOf的区别
- 关于Android Studio使用layout_toLeftOf这种相对布局属性时报错 , 找不到id和R文件的错误
- layout_alignLeft和layout_toLeftOf的区别
- android:layout_toLeftOf 指定ID 提示未定的ID
- android:layout_alignleft layout_toleftof区别详解
- layout_gravity 和 gravity 并且 layout_alignRigh和layout_toRightOf
- RelativeLayout 中android:layout_toRightOf无效原因
- android studio 编译的时候出现的错误和解决方法
- android 动态调整RelativeLayout布局控件的相对位置 layout_toLeftOf 之类的
- android之解析包时出现错误
- Android 5.0.1 Layout_toLeftOf不生效
- android 使用javah出现无法访问的错误!
- android源码下载出现的错误
- 数据结构实验之栈四:括号匹配
- linphone-PayloadTypeImpl文件对应的JNI层文件分析
- JVM调优总结(这个总结得比较全面)
- 顺序表应用1:多余元素删除之移位算法
- 消息队列
- android之layout_toLeftOf和layout_toRightOf出现的错误
- 操作系统--Linux学习
- 搭建Jenkins+Github集成环境
- Linux下的C语言学习笔记(1)
- POJ 3258 River Hopscotch (二分 + 最大化最小值 + 模拟双向链表)
- Ural 1303. Minimal Coverage
- Arlequin
- 数据库问题原因详解(脏读、不可重复读、幻读)
- 顺序表应用2:多余元素删除之建表算法