2014-09-30 91 views
0

我想用9patch形象,但它看起來模糊的device.Here你可以看到:9patch圖像看起來很模糊

enter image description here

你可以看到邊緣模糊。

這是我的目標:

enter image description here

這是我9patch圖像:

enter image description here

你可以看到,它看起來又大又在device.This模糊的是我的XML :

<TextView 
    android:id="@+id/user_name" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_marginTop="6dp" 
    android:layout_marginRight="6dp" 
    android:layout_marginLeft="4dp" 
    android:paddingTop="10dp" 
    android:paddingLeft="15dp" 
    android:paddingRight="5dp" 
    android:gravity="left" 
    android:layout_gravity="left" 
    android:text="dfgdfgdf" 
    android:textSize="12dp" 
    android:background="@drawable/mes3" /> 

如何我能解決這個問題嗎?

回答

1

刪除左側的黑色邊框,就在左側的「箭頭」左側,還有沿着底部的那個你有那個陰影的地方。左邊和上邊的黑色條紋告訴UI哪些部分可以拉伸,所以這就是爲什麼他們被拉伸和看起來模糊。

+0

我這樣做:http://oi62.tinypic.com/kebtbb.jpg結果:http://prntscr.com/4s0fsw箭頭依然模糊不清。它有什麼問題? – 2014-10-01 09:47:38

+0

確保您將資源放置在正確的可繪製目錄中,以獲取其密度。如果默認密度是xhdpi,它應該去那裏。它看起來好像被放置在「可繪製」的位置,但被用在更高密度的設備上,所以圖像在拉伸前被放大。 – 2014-10-01 11:10:22

+0

謝謝,現在看起來不錯。我拖到xhdpi文件夾,因爲我正在測試Galaxy s5。但是我應該怎麼做mdpi,hdpi,ldpi等設備?我不知道我應該怎樣在其他設備上對此圖像進行調整? – 2014-10-01 11:31:28

相關問題