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