Android 查看页面指示器-选项卡指示器显示三星手机上扭曲的图像。有解决办法吗?

Android 查看页面指示器-选项卡指示器显示三星手机上扭曲的图像。有解决办法吗?,android,android-fragments,android-viewpager,android-styles,viewpagerindicator,Android,Android Fragments,Android Viewpager,Android Styles,Viewpagerindicator,我正在尝试使用Viewpage指示器编写一个应用程序-由Jake Wharton编写。在我在三星GT-I9082上遇到这个问题之前,它工作得非常好。2个标签指示器图像看起来非常奇怪。我不知道从哪里开始调试。请帮忙 以下是一个在许多设备上看起来都正常的版本: 以下是三星GT-I9082上看起来迷失方向的版本: 任何指针,我从哪里开始调试 以下是我的代码,用于设置选项卡页面指示器的样式: <style name="Widget.HomePageIndicator" parent="Widg

我正在尝试使用Viewpage指示器编写一个应用程序-由Jake Wharton编写。在我在三星GT-I9082上遇到这个问题之前,它工作得非常好。2个标签指示器图像看起来非常奇怪。我不知道从哪里开始调试。请帮忙

以下是一个在许多设备上看起来都正常的版本:

以下是三星GT-I9082上看起来迷失方向的版本:

任何指针,我从哪里开始调试

以下是我的代码,用于设置选项卡页面指示器的样式:

<style name="Widget.HomePageIndicator" parent="Widget">
        <item name="android:gravity">center</item>
        <item name="android:background">@drawable/homepage_tab_indicator</item>
        <item name="android:paddingLeft">22dip</item>
        <item name="android:paddingRight">22dip</item>
        <item name="android:paddingTop">5dp</item>
        <item name="android:paddingBottom">5dp</item>
        <item name="android:textSize">15sp</item>
        <item name="android:textColor">@android:color/white</item>
        <item name="android:maxLines">1</item>
    </style>
以下是主页_tab_indicator.xml

<?xml version="1.0" encoding="utf-8"?>

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <!-- Non focused states -->
    <item android:state_focused="false" android:state_selected="false" android:state_pressed="false" android:drawable="@drawable/home_screen_tab_unselected_holo" />
    <item android:state_focused="false" android:state_selected="true"  android:state_pressed="false" android:drawable="@drawable/home_screen_selected_holo" />

    <!-- Focused states -->
    <item android:state_focused="true" android:state_selected="false" android:state_pressed="false" android:drawable="@drawable/home_screen_unselected_focused_holo" />
    <item android:state_focused="true" android:state_selected="true"  android:state_pressed="false" android:drawable="@drawable/home_screen_selected_focused" />

    <!-- Pressed -->
    <!--    Non focused states -->
    <item android:state_focused="false" android:state_selected="false" android:state_pressed="true" android:drawable="@drawable/home_screen_tab_unselected_pressed_holo" />
    <item android:state_focused="false" android:state_selected="true"  android:state_pressed="true" android:drawable="@drawable/home_screen_selected_pressed_holo" />

    <!--    Focused states -->
    <item android:state_focused="true" android:state_selected="false" android:state_pressed="true" android:drawable="@drawable/home_screen_tab_unselected_pressed_holo" />
    <item android:state_focused="true" android:state_selected="true"  android:state_pressed="true" android:drawable="@drawable/home_screen_selected_pressed_holo" />
</selector>

过了很长时间,我解决了这个问题。希望这能帮助任何遇到这种奇怪行为的人。问题是我没有在所有州使用9个补丁图像。这会导致某些设备出现渲染问题。生成9个补丁图像后,我得到了预期的输出。另外,别忘了在每9个补丁图片的命名中加上.9-我没有这样做。这个问题还有一个原因