Kodi ——6 Controls (3) Button Control

6.3 Button Control

    button control用于在kodi中创建按钮,你可以选择位置、大小和按钮的外观,同时可以选择创建按钮的时候执行那种操作。

6.3.1 Example

<control type="button" id="1">
      <description>My first button control</description>
      <left>80</left>
      <top>60</top>
      <width>250</width>
      <height>200</height>
      <visible>true</visible>
      <colordiffuse>FFFFFFFF</colordiffuse>
      <texturefocus colordiffuse="FFFFAAFF">myfocustexture.png</texturefocus>
      <texturenofocus colordiffuse="FFFFAAFF">mynormaltexture.png</texturenofocus>
      <label>29</label>
      <wrapmultiline>true</wrapmultiline>
      <font>font12</font>
      <textcolor>FFFFFFFF</textcolor>
      <focusedcolor>FFFFFFFF</focusedcolor>
      <disabledcolor>80FFFFFF</disabledcolor>
      <invalidcolor>FFFFFFFF</invalidcolor>
      <align></align>
      <aligny></aligny>
      <textoffsetx></textoffsetx>
      <textoffsety></textoffsety>
      <pulseonselect></pulseonselect>
      <onclick>XBMC.ActivateWindow(MyVideos)</onclick>
      <onfocus>-</onfocus>
      <onunfocus>-</onunfocus>
      <onup>2</onup>
      <ondown>3</ondown>
      <onleft>1</onleft>
      <onright>1</onright>
</control>

6.3.2 Available tags

    除了默认控件标签下面的标签可用。请注意,每个标签仅是小写。这一点很重要,因为XML标签是区分大小写的。


tagDescription
texturefocus当按钮获取焦点时,指定需要显示的图片。 See here for additional information about textures.
texturenofocus当按钮失去焦点时,指定需要显示的图片。
label按钮上要用到的标签,可以在string.xml中定义,或者只是一个文字标签。
font按钮标签需要的字体。 定义在 fonts.xml.
textcolorColor used for displaying the button label. In AARRGGBB hex format, or a name from the colour theme.
focusedcolorColor used for the button label when the button has in focus. In AARRGGBB hex format or a name from the colour theme.
disabledcolorColor used for the button label if the button is disabled. In AARRGGBB hex format or a name from the colour theme.
invalidcolorColor used for the button if the user entered some invalid value. In AARRGGBB hex format or a name from the colour theme.
shadowcolorSpecifies the color of the drop shadow on the text, in AARRGGBB format, or a name from the colour theme.
angleThe angle the text should be rendered at, in degrees. A value of 0 is horizontal.
alignLabel horizontal alignment on the button. Defaults to left, can also be center or right.
alignyLabel vertical alignment on the button. Defaults to top, can also be center.
textoffsetxAmount to offset the label from the left (or right) edge of the button when using left or right alignment.
textoffsetyAmount to offset the label from the top edge of the button when using top alignment.
textwidthWill truncate any text that's too long.
onclick指定在按下按钮时执行的操作。应该是一个内置的功能。在这里看到更多的信息。您可能有多个<onclick>标签,他们会按顺序执行 See here for more information.
onfocusSpecifies the action to perform when the button is focused. Should be a built in function. The action is performed after any focus animations have completed. See here for more information.
onunfocusSpecifies the action to perform when the button loses focus. Should be a built in function.
wrapmultilineWill wrap the label across multiple lines if the label exceeds the control width.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值