我對標準方法canvas.drawCircle
有一個奇怪的問題。canvas.drawCircle不起作用 - 當drawLine工作時 - 可能是使用Sherlock導致的?
雖然我在Android 4.0.4上運行完全相同的代碼在三星Galaxy S3上,而在另一個S2上運行2.1,它的工作原理沒有問題。在調用drawCircle
和drawPath
時,帶有4.0.3的Acer 500平板電腦上的相同代碼不會繪製任何內容。
這是代碼:
Paint thickLine = new Paint(scalePaint);
thickLine.setStrokeWidth(0.07f);
thickLine.setColor(Color.argb(0xff, 0xff, 0x36, 0x33));
thickLine.setFlags(Paint.ANTI_ALIAS_FLAG);
canvas.drawLine(0.5f, 0.5f, 0.1f, 0.1f, thickLine);
canvas.drawCircle(0.5f, 0.5f, 0.15f, thickLine);
但drawLine
作品在所有這三個設備!
此外,我剛纔提到的代碼 - 之後我將標準片段更改爲SherlockFragments,並在幾處修改了應用中的代碼 - 總是在S3上進行測試。所以我不知道在哪個階段宏基開始不再工作了。
我還使用了包含此代碼的舊版本的繪圖類(在對應用進行所有更改之前),並將其複製到現在使用Sherlock的新版本中 - 即使項目代碼的此階段不再工作描述。
所以我想它可能是與福爾摩斯 - 但是,我沒有任何想法如何以及爲什麼 - 如果在所有....
人有一些類似的體驗,drawLine
的作品,但drawCircle
和drawPath
不? - 使用或不使用福爾摩斯
非常感謝
我可以告訴你,這與ActionBarSherlock無關。 –
非常感謝你,現在我可以專注於我所做的所有其他修改......另外,順便說一句,超級工作 - 我最近纔開始使用Sherlock - 但它很棒。非常感謝! – user387184