温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

在AWTK中怎么让文本滚动起来

发布时间:2021-12-29 14:02:10 来源:亿速云 阅读:118 作者:iii 栏目:互联网科技

这篇文章主要介绍“在AWTK中怎么让文本滚动起来”,在日常操作中,相信很多人在在AWTK中怎么让文本滚动起来问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”在AWTK中怎么让文本滚动起来”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

AWTK 提供了 hscroll_label_t 控件,可以轻松满足文本滚动的需求。

一、基本用法

示例:

<window anim_hint="htranslate" text="hscroll_label" children_layout="default(c=1,h=30,xm=10,s=5)">
  <hscroll_label text="炫酷的 GUI 引擎。" /> 
  <hscroll_label text="炫酷的 GUI 引擎。" /> 

  <hscroll_label 
    lull="1000"
    loop="true"
    yoyo="true"
    ellipses="true"
    focusable="true"
    text="(always ellipses loop yoyo) 为用户提供一个功能强大、高效可靠、简单易用、可轻松做出炫酷效果的 GUI 引擎。" /> 

  <hscroll_label 
    focusable="true"
    only_focus="true"
    text="(only_focus noloop) 为用户提供一个功能强大、高效可靠、简单易用、可轻松做出炫酷效果的 GUI 引擎。" /> 

  <hscroll_label 
    loop="true"
    ellipses="true"
    focusable="true"
    only_focus="true"
    text="(only_focus ellipses loop) 为用户提供一个功能强大、高效可靠、简单易用、可轻松做出炫酷效果的 GUI 引擎。" /> 

  <hscroll_label 
    
    loop="true"
    yoyo="true"
    ellipses="true"
    focusable="true"
    only_focus="true"
    text="(only_focus ellipses loop yoyo) 为用户提供一个功能强大、高效可靠、简单易用、可轻松做出炫酷效果的 GUI 引擎。" /> 

</window>

二、扩展用法

但有时用的不是单纯的文本控件,而是列表项、多选按钮、单选按钮或其它功能的控件,那该怎么办呢?

其实也很简单,把 hscroll_label 作为该控件的子控件,并指定 only_parent_focus 属性为 true 即可。

示例:

<window anim_hint="htranslate" move_focus_prev_key="up" move_focus_next_key="down" text="Basic Controls">
  <row x="0" y="180" w="-50" h="90" children_layout="default(r=1,c=2,m=2)">
    <column children_layout="default(r=3,c=1,ym=2,s=10)" >
      <check_button name="r1" focusable="true" >
        <hscroll_label only_parent_focus="true" x="right" y="middle" w="-30" h="100%"
          text="1.AWTK 为用户提供一个功能强大、高效可靠、简单易用、可轻松做出炫酷效果的 GUI 引擎。" /> 
      </check_button>

      <check_button name="r2" focusable="true">
        <hscroll_label only_parent_focus="true" x="right" y="middle" w="-30" h="100%"
          text="2.AWTK 为用户提供一个功能强大、高效可靠、简单易用、可轻松做出炫酷效果的 GUI 引擎。" /> 
      </check_button>

      <check_button name="r3" value="true" focusable="true">
        <hscroll_label only_parent_focus="true" x="right" y="middle" w="-30" h="100%"
          text="3.AWTK 为用户提供一个功能强大、高效可靠、简单易用、可轻松做出炫酷效果的 GUI 引擎。" /> 
      </check_button>
    </column>
  </row>
</window>

到此,关于“在AWTK中怎么让文本滚动起来”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注亿速云网站,小编会继续努力为大家带来更多实用的文章!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI