钛:标签上研磨问题标签、问题

由网友(ン何以述情ヲ)分享简介:Android版 我有一个表行两个标签。我想设置这两个标签,垂直的,但 firstLabel 重叠第二个。由于 firstLabel 的身高是自动,它包含动态文本如10日线,20日线。 I have two labels in a table row. I am trying to set these two...

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)试过根据文本的长度的标签,但设置的高度不能修复它。

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.

阅读全文

相关推荐

最新文章