2016-04-18 2 views
0

Ich entwickle eine Chat-App. Ich kann nicht die Ballons wachsen oder schrumpfen nach dem Text ..Sprechblasen - iOS - Android

Hat jemand eine Idee, wie ich das tun kann? Mein Code ist zur Zeit wie folgt:

var scrollTxtResp = Ti.UI.createScrollView({ 
    contentWidth: 'auto', 
    contentHeight: 'auto', 
    layout: 'vertical', 
    showVerticalScrollIndicator: true, 
    showHorizontalScrollIndicator: false, 
    top:0, 
    height: '100%', 
    width: '100%' 
}); 
view.add(scrollTxtResp); 
    var lblTexto = Titanium.UI.createLabel({ 
left: 2, 
width: '98%', 
height: 'auto', 
textAlign: Titanium.UI.TEXT_ALIGNMENT_LEFT, 
text: Dec(json[pos].content), 
color: clr_aux5, 
font: { fontFamily: font_primaria, fontSize: 15 } 
}); 
scrollTxtResp.add(lblTexto); 

Screenshot

ich klassische Entwicklung bin mit mit SDK 5.2.2 GA (iOS/Android)

Vielen Dank im Voraus.

Antwort

2

Es gibt auch zwei Module, die Blase Ansichten schaffen:

Sie eine Ansicht erstellen werden, die Sie mit zum Beispiel füllen Etiketten:

var TiBubble = require('be.k0suke.tibubble'); 
var bubble = TiBubble.createView({ 
    top: 0, 
    left: 10, 
    width: Ti.UI.SIZE, // just fit from contained label 
    height: Ti.UI.SIZE, // just fit from contained label 
    bubbleColor: '#dfdee5', // default: #fff 
    bubbleRadius: 20, // default: 20 
    bubbleBeak: TiBubble.BUBBLE_BEAK_LEFT // default BUBBLE_BEAK_LEFT 
    bubbleBeakVertical: TiBubble.BUBBLE_BEAK_UPPER // default BUBBLE_BEAK_LOWER 
}); 
bubble.add(label); 
+0

Großartig !!! Vielen Dank! –