超文本控件。
属性 |
属性说明 |
---|---|
BorderRadius |
控件边框角度 |
HTML |
获取与设置HTML。 |
SelfLayout |
控件自身布局 |
TextSelectable |
是否允许修改文本内容 |
URI |
获取与设置URI。 |
C#:
htmlView1.HTML = "<h1> This HTML snippet is now rendered with native components! </h1><h2> Enjoy a webview-free and blazing fast application</h2 ><img src ='https://www.smobiler.com/images/control/listview/phone1.png' /><em style='textAlign: center;' > Look at how happy this native cat is</em>";
C#:
htmlView1.HTML = @"<div class='scrolllabel' style='height:20px; width: 20px; background-color: rgb(255, 0, 0);'></div>
<svg class='svgpath' width='256' height='112' viewBox='0 0 256 112'>
<path fill='none'' stroke='currentColor' stroke-width='1' d='M8,56 C8,33.90861 25.90861,16 48,16 C70.09139,16 88,33.90861 88,56 C88,78.09139 105.90861,92 128,92 C150.09139,92 160,72 160,56 C160,40 148,24 128,24 C108,24 96,40 96,56 C96,72 105.90861,92 128,92 C154,93 168,78 168,56 C168,33.90861 185.90861,16 208,16 C230.09139,16 248,33.90861 248,56 C248,78.09139 230.09139,96 208,96 L48,96 C25.90861,96 8,78.09139 8,56 Z'></path>
</svg>";
C#:
//Client.JSEval 可执行任意js 第一个参数为js代码,第二个参数为回调事件。
Client.JSEval(@"var path = anime.path('.svgpath path');
anime({targets: '.scrolllabel',
translateX: path('x'),
translateY: path('y'),
rotate: path('angle'),
easing: 'linear',
duration: 2000,
loop: true
})
", (obj, args) =>
{
if (args.errorCode == 0)
Toast("success");
});
运行效果: