|
- var 日志 = new floatUI();
- 日志.loadXML(
- '<LinearLayout orientation="vertical" w="15" h="350" gravity="center">' +
- ' <TextView id="rz" textColor="#ff3ee4" background="#000000" layout_width="wrap_content" layout_height="wrap_content" />' +
- '</LinearLayout>'
- );
- var g_日志 = 日志.findViewById('rz');
- if (g_日志) {
- // 延迟设置位置
- setTimeout(function() {
- 日志.setPosition(0, (screen.getScreenHeight() * 0.4));
- }, 100);
-
- g_日志.setText("这里写你的日志内容");
- // 更新功能
- function updateLog(newContent) {
- g_日志.setText(newContent);
- }
- // 示例使用:每隔一段时间更新日志内容
- setInterval(function() {
- var currentTime = new Date().toLocaleString();
- updateLog("更新日志时间: " + currentTime);
- }, 10000);
- } else {
- // 使用 alert 或其他方式输出错误信息
- alert("日志视图没有找到。");
- }
复制代码
|
|