안녕하세요.
custom seekbar를 만들어서 적용을 시켜보았는데,
안드로이드 에뮬레이터에서는 정상동작합니다.
그런데 실제 디바이스에서 돌려보니 custom seekbar가 제대로 동작을 안하네요.
seekbar에서 android:progressDrawable 속성이나 android:thumb 속성을 뺴면 제대로 보입니다.
그런데 제가 원하는 건 두 가지 속성을 모두 적용시키는건데.. 왜그런지는 모르겠지만 에뮬에서는 다 적용이 되는데 실제 디바이스에서 실행시키면 android:thumb 속성만 적용되서 보이고 progressDrawable 속성은 아예 안보입니다.. 이런 경우에는 어떤것을 의심해봐야 할까요..?
<activity_main>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/activity_main"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="speakeragent.com.testagentplayer.MainActivity">
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="MediaPlayer 활용"
android:textAppearance="?android:attr/textAppearanceLarge" />
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/textView1"
android:text="시작" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/button1"
android:layout_below="@+id/button1"
android:visibility="invisible"
android:text="일시정지" />
<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/button2"
android:layout_below="@+id/button2"
android:visibility="invisible"
android:text="재시작" />
<Button
android:id="@+id/button4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/button3"
android:layout_below="@+id/button3"
android:visibility="invisible"
android:text="종료" />
<SeekBar
android:id="@+id/seekBar1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/button4"
android:layout_marginTop="18dp"
android:progressDrawable="@drawable/seekbar_seekbar1"
android:thumb="@drawable/seekbar_thumb1"
android:thumbOffset="0dp" />
</RelativeLayout>
<seekbar_seekbar1>
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<shape android:shape="line">
<stroke android:width="6dp" android:color="#D5D5D5" />
</shape>
</item>
<item android:id="@android:id/secondaryProgress">
<clip>
<shape android:shape="line">
<stroke android:width="6dp" android:color="#B2CCFF"/>
</shape>
</clip>
</item>
<item android:id="@android:id/progress">
<clip>
<shape android:shape="line">
<stroke android:width="6dp" android:color="#6799FF"/>
</shape>
</clip>
</item>
</layer-list>
<seekbar_thumb1>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#B2CCFF"></solid>
<stroke android:width="2dp"
android:color="#B2CCFF"/>
<size
android:width="6dp"
android:height="6dp"/>
</shape>