今天在使用seekbar遇到一个问题,也不是大问题,但是有强迫症,总觉得不舒服,就是右边显示的布局总弹出Rendering Problems。
运行没有问题,一样可以用,就是在写XML时很不爽,总感觉有什么问题。看一下seekbar代码。
<SeekBar
android:id="@+id/play_progress"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="3dp"
android:layout_marginBottom="-2dp"
android:layout_marginLeft="-17dp"
android:layout_marginRight="-17dp"
android:layout_marginTop="-3dp"
android:progressDrawable="@drawable/music_progress_bg"
android:thumb="@null" />
detail中表达意思大概就是seekbar的问题,我找到两种办法可以不弹出来,①API调成20就不弹出来,②或者把style=”?android:attr/progressBarStyleHorizontal”删掉也不弹出来。运行也不影响,上网查style=”?android:attr/progressBarStyleHorizontal”这个就是水平的进度条样式。
具体原因不太清除,但是我搜了一下style=”?android:attr/progressBarStyleHorizontal”这个属性是progressbar的,按理来说seekbar是progressBar子类的子类应该可以用,但是不知道哪里的问题;还有吧API调低也不弹出来,不知道什么原因。
这种问题遇到最多的就是导入github上的项目时,经常遇到。知道的大神欢迎留言。