Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Contributor
anhhungxadieuuit
Posts: 27
Registered: ‎12-18-2012
My Device: Z10, Playbook
My Carrier: Viettel
Accepted Solution

How to add Image to TextArea or TextField

Hi there,

I want to add some custom emotion from image to my textarea or textfield.

I try to user with textarea with html but they doesn't support <img> tag.

 

How to do this :Helpsmilie::Helpsmilie::Helpsmilie::Helpsmilie::Helpsmilie::Helpsmilie:

 

Please use plain text.
Developer
shahumang8
Posts: 638
Registered: ‎08-09-2010
My Device: Not Specified

Re: How to add Image to TextArea or TextField

Hi,

 

 Build Custom TextField or TextArea.

Please use plain text.
Contributor
anhhungxadieuuit
Posts: 27
Registered: ‎12-18-2012
My Device: Z10, Playbook
My Carrier: Viettel

Re: How to add Image to TextArea or TextField

Dear shahumang8,

Of course, I know how to custom TextArea and TextField,

but when you do that you will use that TextArea and TextField in your Custom Control and the problem happen again with your TextArea and TextField.

If you have one or serveral image with text, that is not problem, but if you have many images inside text, how do use know exactly position to locate the image in the text.

 

Exmaple text:

 

"blap blap blap ..... blap <image1> blap blap blap ..... blapblap blap

blap .....<image2> blapblap blap blap ..... blapblap blap blap<image3> ..... blap"

 

<image1><image2><image3> is the image in the text

 

I can't use many TextArea or TextField with ImageView because It look not beautiful and text will be wraped not as I expected.

Please use plain text.
BlackBerry Development Advisor
sabdelsayed
Posts: 249
Registered: ‎08-17-2012
My Device: BlackBerry Z10 and Q10
My Carrier: Bell

Re: How to add Image to TextArea or TextField

[ Edited ]

Hi anhhungxadieuuit, to use emoticons in the TextArea/TextField, you need to use "Chat" as the controls' text input mode. For more on the topic, please reference the API documenation. An example on how to do so: 

 

 

import bb.cascades 1.0
   
Page {
    content: Container {
        TextField {
            hintText: "Tap here to display a chat keyboard"
              
            inputMode: TextFieldInputMode.Chat
        }
          
        TextArea {
            hintText: "Tap here to display a chat keyboard"
              
            inputMode: TextAreaInputMode.Chat
        }
    } // end of Container
} // end of Page

 Another way is to set the "Chat" flag on. Example QML code:

 

import bb.cascades 1.0
  
Page {
    content: TextField {
        inputMode: TextFieldInputMode.Text
         
        content {
            flags: TextContentFlag.Emoticons
        }
    }
}

 
@SamarAbdelsayed

Did this answer your question? Please accept post as solution.
Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker
Please use plain text.
Contributor
anhhungxadieuuit
Posts: 27
Registered: ‎12-18-2012
My Device: Z10, Playbook
My Carrier: Viettel

Re: How to add Image to TextArea or TextField

Thanks sabdelsayed,

 

This is OK with default emotion by BB, but I mean custom emotion, How can I custom emotion in TextField or TextArea.

 Is there another RichTextField can accept custom emotion :smileyindifferent::smileyindifferent:

Please use plain text.
Contributor
chanzdevilz
Posts: 16
Registered: ‎06-06-2011
My Device: 8520
My Carrier: developer

Re: How to add Image to TextArea or TextField

I have same question. So far i know, if you want to using image (emoticons) in TextArea or TextField, you need emoji. Sorry for asking here, cause i think have "same topic". How to make colorful image in TTF ? so far i know TTF only monochrome image.

Please use plain text.
BlackBerry Development Advisor
sabdelsayed
Posts: 249
Registered: ‎08-17-2012
My Device: BlackBerry Z10 and Q10
My Carrier: Bell

Re: How to add Image to TextArea or TextField

[ Edited ]

All Cascades text controls support Emoji. For the details on how to use Emoji, please go to the Emoji section at this link of the documentation. However, unfortantely, there is currently no API to load custom emoticons.

 

 

@SamarAbdelsayed

Did this answer your question? Please accept post as solution.
Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker
Please use plain text.