钛:标签上研磨问题 [英] Titanium : Label over lapping issue

查看:122
本文介绍了钛:标签上研磨问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Android版

我有一个表行两个标签。我想设置这两个标签,垂直的,但 firstLabel 重叠第二个。由于 firstLabel 的身高是自动,它包含动态文本如10日线,20日线。

I have two labels in a table row. I am trying to set these two label vertical but the firstLabel overlaps the second one. As firstLabel's height is "auto" and it contains dynamic text e.g. 10 lines , 20 line.

由于 firstLabel 的动力高度我无法设置 secondLabel 的顶部,这样它就会重叠。

Due to dynamic height of firstLabel I couldn't set secondLabel's top so it gets overlapped.

我试过可在SO和Appcelerator的所有可能的解决方案,但没有找到此修复程序。

I've tried all possible solution available on the SO and Appcelerator but couldn't find the fix.

1)。我无法得到的 firstLabel 的高度之后,或将其添加到视图之前,表的行等等...

1). I couldn't get height of firstLabel after or before adding it to the view, table's row etc...

2)试过<一个href="http://developer.appcelerator.com/question/31191/retrieving-height-of-labels-after-setting-text-value"相对=nofollow>根据文本的长度的标签,但设置的高度不能修复它。

2) Tried to set height of label according to text's length but couldn't fix it .

仍在寻找解决方案。

推荐答案

什么,你需要做的是不是要设置布局垂直的标签上,而是对所包含的所有标签的​​看法。如果父视图具有垂直布局,就会立即将第二标签的第一标签结束后。此外,设置第二个标签的顶属性将地方label1和标签2顶部底部之间有很多单位想在CSS块元素的相对位置。

What you'll need to do is not to set the layout to vertical on the label, but rather on the view that is containing all the labels. If the parent view has a vertical layout, it will place the second label immediately after the first label ends. Additionally, setting the "top" property of the second label will place that many units between the bottom of label1 and top of label 2. Think relative positioning of block elements in CSS.

这篇关于钛:标签上研磨问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆