Comments (3)
对于 XML 来说,设置属性例如下代码
<Button width="100" height="30" margin="10,10,10,10" text="TestButton" normaltextcolor="darkcolor" />
对于 CSS 来说
Button {
width: 100px;
height: 30px;
margin: 10px;
color: #222;
}
除了 Button text 的定义可能不一样以外,其他基本都是类似的,XML 中控件支持的属性远没有 CSS2 的特性支持要多,CSS3 就更加多种多样了。如果您还认为 XML 的属性太多,或者您更倾向于使用 CSS 方式来定义控件的样式,也欢迎您开启一个分支提交一些基础结构代码,来一起完善类似功能。
from nim_duilib_framework.
<RichEdit class="te_simple_edit te_simple_edit_color" name="password" prompttext="Password" promptcolor="dark_gray" password="true" font="1" width="stretch" height="25" bordersize="1" bordercolor="te_border_color" margin="0,5,0,0" borderround="6,6"></RichEdit>
比如这样的 xml 就有点多。xml 还容易出错,不易读,如果界面复杂一些的话,会有很多嵌套。并且改的时候把tag 不小心删掉会导致加载失败。不容易排错。
当然了,xml这种方式比自绘控件强太多了。
from nim_duilib_framework.
从使用上您可以用一些功能丰富的 XML 编辑器,比如 notepad++、VisualStudio 的文本编辑器都是很好的 XML 文件编辑工具。这些编辑器在出现缺少关键字或者语法错误的时候都会有相应的界面提示。
另外您也可以在定义自定义全局 class 属性放到 global.xml 中,这样就不会产生大量重复的样式代码了。这类似 LESS 语法中的全局变量,方法都是可以变通的。
from nim_duilib_framework.
Related Issues (20)
- LIST中插入ITEM导致滚动条刷新问题 HOT 2
- 控件不响应接收不到 HOT 2
- combox选择一个子项的时候,onselect函数为什么会触发三次 HOT 1
- 能否提供一个模态对话框的例子
- ui 图标在一些高分辨率机器上 边缘锯齿严重
- list怎么去掉了 header
- 如何在richedit中添加图片等?
- mini_blink加载的页面不响应鼠标点击
- TabBox::Remove问题
- GetDpiImageFullPath函数有泄漏 HOT 2
- 能否支持运行期间响应DPI变化
- master分支能否支持克隆下来能直接使用vs2022编译通过的 HOT 3
- 想用该框架来做音视频通话,请问是否合适?可以给一些思路和建议吗?感谢 HOT 2
- OptionBox设置selected属性后无效 而且程序运行崩溃
- 自定义控件绘制本地摄像头数据没有颜色 HOT 1
- duiLib有什么交流群吗?这个项目目前还在维护吗?
- 缺少cefwrapper的lib库
- ui::GlobalManager::CreateBoxWithCache返回null;
- 插件模块的开发
- shadowattached=“false“ 导致 RichEdit 透明穿透 到底怎么修复啊!还是不会! HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nim_duilib_framework.