2016-07-12 4 views
2

私はinitメソッドにカスタムイメージを渡すことでJSQMessagesViewControllerのデフォルトMessagesBubbleImageを変更しようと取り組んでいないが、それは働いていない、ここで私はあなたの質問が、私に取り組んでいたコードJSQMessagesViewController changedBubbleImage

outgoingBubbleImageView = JSQMessagesBubbleImageFactory.init(bubbleImage: UIImage(named: "bubbleMine"), capInsets: UIEdgeInsetsZero).outgoingMessagesBubbleImageWithColor(UIColor.grayColor()) 

答えて

0

こんにちはですObjective Cの上で解決していたので、私は私の答えとDemoModelDataInit

JSQMessagesBubbleImageFactory *bubbleFactory = [[JSQMessagesBubbleImageFactory alloc] initWithBubbleImage:[UIImage imageNamed:@"bubbleMine"] capInsets:UIEdgeInsetsZero layoutDirection:UIUserInterfaceLayoutDirectionRightToLeft]; 

self.outgoingBubbleImageData = [bubbleFactory outgoingMessagesBubbleImageWithColor:[UIColor grayColor]]; 
でスウィフト

への翻訳を掲載します

スウィフト翻訳

let bubbleFactory = JSQMessagesBubbleImageFactory(bubbleImage: UIImage(named: "bubbleMine")!, capInsets: UIEdgeInsetsZero, layoutDirection: .RightToLeft) 

self.outgoingBubbleImageData = bubbleFactory.outgoingMessagesBubbleImageWithColor(UIColor.grayColor()) 
self.incomingBubbleImageData = bubbleFactory.outgoingMessagesBubbleImageWithColor(UIColor.jsq_messageBubbleGreenColor()) 

形状は、あなたがこのことから得るものであることに注意してください、ではない私は、私はOK

を働くために、これは、あなたの役に立てば幸い色

関連する問題