错误是这样的,布局文件如下,总是在SeekBar里面的这一句android:layout_toLeftOf="@id/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"/><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的参数需要在使用它们之前定义,

刚开始只想着从左到右的顺序挨个写,显得有条理,看来我想多了.

错误就消失了,

更多相关文章

  1. Unity Android打包apk安装错误INSTALL_FAILED_CONFLICTING_PROVI
  2. Android纠正Activity横竖屏切换的生命周期的错误
  3. android 编译错误--超出接口数量限制
  4. Android——导入已存在的android工程时出现红叉错误“AndroidMan
  5. Android studio 启动问题,错误
  6. Android证书创建之 keytool 错误:java.io.IOException:Incorrect
  7. android:WindowTitleBackground错误
  8. android 解决错误:Intel HAXM is required to run this AVD
  9. res\drawable-hdpi\new.png:0: error: invalid symbol: 'new'

随机推荐

  1. javascript-基础(五)
  2. classList对象、blur事件进行表单非空验
  3. 浅谈并发处理PHP进程间通信之System V IP
  4. 实例演示classList对象及表单非空验证
  5. 演示classList和表单非空验证
  6. 获取焦点提示以及失去焦点提示
  7. 详解PHP设计模式之依赖注入模式
  8. 解析PHP观察者模式Observer
  9. FreeRTOS动态内存分配管理heap_5示例
  10. 浅谈PHP设计模式之对象池模式Pool