2015-04-30 11 views
0

我在xcode圖像資產中添加了PDF矢量文件。矢量文件具有顏色和設計。但是,當它在模擬器上生成時,形狀會保留,但顏色和設計全部消失,取而代之的是平坦的顏色。iOS應用中生成的圖像與原始矢量圖像看起來不同

// code to add the button 
- (void) addReplyButton:(STRContent *)content { 
    UIButton *replyBtn = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 
    replyBtn.frame = CGRectMake(0, 0, 0, 0); 
    [[replyBtn imageView] setContentMode: UIViewContentModeScaleAspectFit]; 
    [replyBtn setImage:[UIImage imageNamed:@"reply_button"] forState:UIControlStateNormal]; 
    [self.photoView addSubview:replyBtn]; 
} 

原始圖像

the image

輸出

the output

+0

每次都會發生嗎?或有時顯示正確的圖像? – vichevstefan

回答

0

中我發現這個問題 - 我在做UIButtonTypeRoundedRect,其中UIBottomtypeCustom工作。

UIButton *replyBtn = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 
0

我有過類似的問題,在我的情況下,有兩個文件具有相同的文件名。

在這種情況下,它顯示的圖像通過隨機選擇相同的名稱

相關問題