2

正如one of my questions中所建議的,我必須使用帶有漸變的9補丁圖像來顯示listview項目背景。9 patch-image在片段中奇怪的行爲

但是,當我使用9色標圖像,還存在着問題,梯度:

enter image description here

9補丁,test.9.png:

enter image description here

但是,當我在梯度和底部9貼片線之間留下了transperent線1 px高度,對水平內容放置做出了響應,這一切都很好,而且我有很好的漸變效果。

9修補圖像:

enter image description here

,更貼近看到透明單位線:

enter image description here

它是一個結果:

enter image description here

我有很好看的漸變,但有透明的線條,我不需要。在圖像上,您可以看到列表後面的黑色背景,因爲這一行。如何繪製9-補丁圖像以獲得良好的漸變效果並且在背景中沒有「洞」?

我正在使用actionbarsherlock的片段。

回答