0
我使用類似的代碼創建從PNG圖像計數器:的UIImageView的initWithImage失真
counterImage = [UIImage imageNamed:@"counter-1-2-inactive.png"];
UIImageView *counterImageView = [[[UIImageView alloc] initWithImage:counterImage] autorelease];
UILabel *countLabel = [[[UILabel alloc] initWithFrame:counterImageView.frame] autorelease];
[cell addSubview:counterImageView];
[counterImageView addSubview:countLabel];
您可以在下面看到一個結果,在LHS有來自iPhone模擬器,並在RHS有一個計數器一個原始的PNG。
爲什麼質量在最終的UIImageView中略有下降?我該如何改進它?這可能只有1像素高的線,但是在1:1的比例下看起來像是一個計數器從上面縮短了。
生成的counterImageView的大小與原始PNG:40x24相同。
請將您的答案標記爲已接受以結束此問題。 – memmons
@哈克尼安有一天的寬限期,直到我可以接受我自己的答案。 –