【问题标题】:LiveCode negative "firstIndent" - or other way to achieve the effect ("hanging indent")?LiveCode 否定“firstIndent” - 或其他实现效果的方式(“悬挂缩进”)?
【发布时间】:2013-03-08 16:41:58
【问题描述】:

使用字段上的firstIndent 属性,我可以使段落的开头相对于标准边距缩进,这样如果换行,则继续从上一行的第一个字符的左侧开始。

但是如果我给firstIndent设置一个负值,它就没有效果了。

有没有办法实现行从左边开始的效果,但是如果换行了,后面的行会向右缩进?

【问题讨论】:

    标签: user-interface textfield text-alignment livecode


    【解决方案1】:

    您可以通过为“leftindent”设置一个值,为“firstindent”设置一个负值来做到这一点 (注意设置leftindent时需要指定行号)

    set the leftIndent of line 1 of field "A" to 200
    set the firstIndent of field "A" to -50
    

    【讨论】:

    • 很好的提示。顺便说一句:这个问题所指的“效果”被称为“悬挂缩进”。也许应该编辑标题以使其更易于搜索。
    • 谢谢亚历克斯 - 我没有考虑线属性 - 做得很好!
    • (Knud,好点 - 我还编辑了问题的标题)
    【解决方案2】:

    请注意,字段中行的“leftindent”属性仅在 LiveCode 5.5 版中引入,从 LC 5.5 开始,“firstIndent”属性现在可以应用于行以及整个字段:

    set the firstIndent of line 2 of field "xyzzy" to -10
    

    【讨论】:

    • 谢谢马克 - 这将是我不知道的借口!如果 firstIndent 和 leftIndent 都可以应用于一行,它们如何交互 - 它们只是相互抵消吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-06-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多