作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
线路:
This is the first line and it is long line1.
This is the second line and it is long line2.
显然,这两行末尾都包含“\n”。
但是当设备屏幕很小时,在某些时候。
默认输出:
This is the first line and
it is long line1.
This is the second line and
it is long line2.
预期输出:
This is the first line and
This is the second line and
it is long line1.
it is long line2.
除了使用 ReplacementSpan 在第二行上方绘制第一行之外,作为一种解决方法,我想知道是否可以将这两行视为一条线。我必须采取哪些选择才能实现这样的输出?
最佳答案
“逻辑”解决方案是将第一个换行符 \n
替换为空格。
但就您而言,您似乎想要水平滚动的 TextView :
<TextView
android:lines="2"
android:scrollHorizontally="true"
android:singleLine="true" ... />
我不确定 lines
和 singleLine
属性。
关于java - 是否可以将两条线视为一条线?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39659587/
如何迭代(一行)分割函数给我的每个类? 我试过这个: 编辑(抱歉) $("p").attr("class").split(' ').each (function (i,n){alert(n)}
我有一条垂直线和一条水平线,当我动态调整我的 Canvas 父级时,我想调整它们的大小。 (地标) 我希望水平线始终距 Canvas 的左右边界 25 处,距底部边界 13 处。 垂直线也是如此,距上
我有一个 y 变量,我试图在图形的顶部和底部针对两个相关的 x 轴绘制它(例如 y="立方体中的事物数",x1="立方体的边长", x2="立方体的体积")。我在 numpy 数组中有 y、x1、x2
我想画一条简单的水平线,并在这条线 flex 的地方制作动画。我有这个动画的视频。你能给我一些建议如何开始以及我必须使用哪个 js/css 吗? 都是关于矩形底部的线: http://www.stop
我是一名优秀的程序员,十分优秀!