最近在做一个放在桌面的播放器,其他都好就解决,就是加入SeekBar时就出现加载错误,不知道怎么回事,还有就是加入SeekBar后seekBar.setOnSeekBarChangeListener这个怎么设置,求各位高手大侠帮帮忙啊

解决方案 »

  1.   

    这是布局文件,自己顶一个
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">
    <SeekBar
        android:id="@+id/seekbar"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
    ></SeekBar>   
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal" 
        android:background="@drawable/yes_fcs"><ImageButton
        android:id="@+id/image"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingLeft="30px"
        android:src="@drawable/icon" />
    </LinearLayout>
    </LinearLayout>
      

  2.   

    去掉第二个xmlns:android="http://schemas.android.com/apk/res/android"
      

  3.   

    不行啊,去的只剩SeekBar都还是不行
      

  4.   

    AppWidget默认只能加载一些简单的控件,因为他们都是RemoteView,如果不是RemoteView就会出现加载错误,SeekBar估计不行!TextView,ImageButton可以!
    http://www.cnblogs.com/playing/archive/2011/04/22/2024775.html
      

  5.   

    一个RemoteViews对象(以及,相应的,一个App Widget)可以支持下面这个布局类:以及下面的小部件类:·FrameLayout ·LinearLayout ·RelativeLayout 
    ·AnalogClock ·Button ·Chronometer ·ImageButton ·ImageView ·ProgressBar ·TextView 
      

  6.   

    楼主是怎样用RemoteView加载SeekBar的?我也遇到这个问题,分享下。谢谢!