cancel
Showing results for 
Search instead for 
Did you mean: 

How can I bind two text view elements in the same line?

Former Member
0 Kudos

Hi all:

In my case, it is not allowed that one text view is in the first line and another in the second line. How can I put them always in the same line?

Thanks.

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

Hi yashpal:

I tested it as your idea just now. But the two child containers still cannot be wrapped no matter how you resize the window.

Bruce.

Yashpal
Active Contributor
0 Kudos

Hi,

containers cant be wrapped .......

UI controls inside a can be wrapped ..

so wrap ui controls.

yashpal

Former Member
0 Kudos

Bruce,

Did you set wrapping=true for TextView controls themselves?

VS

Former Member
0 Kudos

Hi Armin:

But if I use the matrix layout the root contain,the first child contain is set as matrixheaddata and the second one is set to matrixdata, the two child containers never be wrapped even you change your windows to a very small size.

Bruce.

Former Member
0 Kudos

Hi Arwin:

Sorry for my unclear explaination.

Now I have two child transparent containers under the root container. And I add three text view into the two child containers individually.

But why the two child containers are both placed from the begin of a row. Not as my expection, they can be palced one by one.

Bruce.

Former Member
0 Kudos

If I understand you correctly, you have two containers C1, C2, each containing some other controls, and you want to have all in one line. Right?

Set the layout of the <b>parent </b>of C1 and C2 (probably the root container of the view) to MatrixLayout, give C1 a MatrixHeadData and C2 a MatrixData as layout data.

Armin

Former Member
0 Kudos

Hi,

Imagination is the limit.. You can try a mix of layout..

I would suggest.. having matrix layout..first container as matrix head data and second container as matrixdata

each transparent container of matrix layout.. and the textviews as matrixdata (matrix head data will make it start in a new row)

regards

Bharathwaj

Yashpal
Active Contributor
0 Kudos

Hi,

as the window resizes the UIcontrols are also resized if wrapping is enabled and they will be in same row.

as u mentioned they are two containers in root container but appears one by one do as below

for root container

set layout - grid layout

colcount - 2

for 1st child container

set layout -grid layout

set colspan - 1

as u requre 3 Ui control in it

set colcount of child container to 3

add the UI controls

set the colspan of UI controls to 1.

do as same for second container

Thanks,

yashpal

Former Member
0 Kudos

Hi yashpal:

Thank you.

But as your suggestion, I have to calculate the number every time the window resizes?Right?

Bruce.

Former Member
0 Kudos

Hi Armin:

Thank you.I had tested you idea.

But a transparent container must take the place of one whole row. How can I avoid this?

Bruce

Former Member
0 Kudos

I don't understand your question.

What is the parent container and what layout has it?

If you want to replace a TextView T inside a container by a pair of two TextViews T1, T2 tied together, then

- create a TransparentContainer C, layout=FlowLayout (wrapping=false)

- add T1, T2 to C

- replace T by C in T's parent container, give C the same layout data that T had

Armin

Former Member
0 Kudos

Put the TextView elements inside a container with FlowLayout and wrapping=false.

Armin

Yashpal
Active Contributor
0 Kudos

Hi,

the best way of doing this is set the layout of rootelement container to "gridlayout" and set the "colspan" property to the no of max element u want in a row means in your case 2.

then create the UI controls and set the colspan property to 1 means UI will take space of one row .

Regards,

yashpal

arun_srinivasan
Contributor
0 Kudos

hi,

set the layout property to "flow layout"

hope this helps,

regards,

arun