0
为什么在创建分辨率文件夹并为该文件生成各种分辨率后,此Galaxy 9平板电脑的9-patch图像看起来不好?我是否错误地创建了9修补程序?下面的下拉菜单看起来很好,但在屏幕上它超小。为什么在我的Galaxy 3平板电脑上这个9-patch图像看起来很糟糕?
更新:我首先包含错误的文件。现在这已被纠正。我正在使用.9.png扩展名。
代码在主 “styles.xml” 文件:
<style name="AppTheme" parent="@android:Theme.Holo.Light.DarkActionBar">
<item name="android:spinnerStyle">@style/spinnerStyle</item>
</style>
<style name="spinnerStyle" parent="@android:style/Widget.Spinner">
<item name="android:background">@drawable/icon_spinner</item>
<item name="android:spinnerMode">dropdown</item>
<item name="android:layout_gravity">center</item>
<item name="android:layout_margin">2dp</item>
<item name="android:padding">2dp</item>
</style>
布局代码:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="match_parent">
<TextView
android:id="@+id/nameTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="0dp"
android:paddingLeft="2dp"
android:textSize="15dp" />
</LinearLayout>
尝试只在左侧使用一个黑色元素(如:http://developer.android.com/tools/help/draw9patch.html) –
@Danil Onyanov:这没有帮助。黑色箭头将移动到下拉框的下部或上部,而不是居中。您所指的图片位于渐变的“中点”,并且没有“图标”需要考虑。 –
对不起...我更新了图片;我上传了错误的一个。 – thecoolmacdude