- LiveCode Mobile Development Cookbook
- Dr Edward Lavieri
- 221字
- 2021-08-05 18:04:01
Dynamically displaying interface objects
Oftentimes, we will create interface objects and only have them appear on the screen when appropriate. For example, you might have a graphic indicator that the user has unread system messages. If the value is 1 or higher, then you might have the graphic visible; otherwise, you might hide it. This recipe shows you how to accomplish this task.
How to do it...
Perform the following steps to dynamically display interface objects:
- Create a new main stack.
- Drag a button to the stack's card.
- Change the name of the new button to
testButton
. - To make an object, such as a button, visible, use the following syntax:
set the visible of <object type> <"object name"> to true
So, for example, if you have a button named
testButton
, your code will be as follows:set the visible of btn "testButton" to true
- To hide the example button from step 4, enter the following code:
set the visible of btn "testButton" to false
- To toggle a button's visibility, add the following code to the button:
if the visible of me is true then set the visible of me to false else set the visible of me to true end if
How it works...
We can use an object's visible
property to dynamically display or hide the object by setting visible
to true
or false
.
推薦閱讀
- RCNP實驗指南:構(gòu)建高級的路由互聯(lián)網(wǎng)絡(luò)(BARI)
- 微商之道
- EDA技術(shù)與VHDL編程
- Learning QGIS 2.0
- Hands-On Full Stack Development with Spring Boot 2 and React(Second Edition)
- HCNA網(wǎng)絡(luò)技術(shù)
- 物聯(lián)網(wǎng)工程概論
- 網(wǎng)絡(luò)利他行為研究:積極心理學(xué)的視角
- Practical Web Penetration Testing
- 物聯(lián)網(wǎng)基礎(chǔ)及應(yīng)用
- 物聯(lián)網(wǎng)M2M開發(fā)技術(shù):基于無線CPU-Q26XX
- Cisco無線局域網(wǎng)配置基礎(chǔ)
- Corona SDK Application Design
- 黑客與反黑工具使用詳解
- 通信系統(tǒng)實戰(zhàn)筆記:無處不在的信號處理