开发者

Placing two TextView together..issue

i need to place two text box in such a way that it sloud look like this..

===================

Username contents contents contents contents

contents contents contents contents contents contents

contents contents contents contents contents contents

====================

Here, the Username is one TextView which is Clickable and "contents" is another Text开发者_开发知识库View.

i had tried with do as above but i couldn't get as desired result..

===================

Username contents contents contents contents

                   contents contents contents contents contents contents

                   contents contents contents contents contents contents

====================

Pls help me out through this...

Thanks.


I solved similar Problems by Using: TV1.setText(Html.fromHtml("<b><font color=#ff0000> Username" +"</font></b> content content content content"));


This is kind of a cheap way to do it, but you could palce two text boxes on top of each other and append the contents to have as many spaces as the user name so essentially you would have:

String usrName = "Username";
String contentText = "";
for(int i = 0; int < usrName.length; i++) {
     contentText = contentText  + " ";
}

contentText = contentText + "The content I want";
TV1.setText(usrName);
TYV2.setText(contentText);


[edit] misunderstood the question... I doubt it can be done like you want it to be done. I would suggest to do your username above the content in a single line..


Have you tried a TableLayout?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜