我正在尝试实例化具有多行功能以及第一个字符大写标志的EditText ,如下所示:
myEditText?.setSingleLine(false)
myEditText?.inputType =
InputType.TYPE_CLASS_TEXT or
InputType.TYPE_TEXT_FLAG_CAP_SENTENCES or
InputType.TYPE_TEXT_FLAG_IME_MULTI_LINE
myEditText?.setImeOptions(EditorInfo.IME_FLAG_NO_ENTER_ACTION)
Run Code Online (Sandbox Code Playgroud)
我还尝试将标志与plus而不是or结合起来:
myEditText?.setSingleLine(false)
myEditText?.inputType =
InputType.TYPE_CLASS_TEXT +
InputType.TYPE_TEXT_FLAG_CAP_SENTENCES +
InputType.TYPE_TEXT_FLAG_IME_MULTI_LINE
myEditText?.setImeOptions(EditorInfo.IME_FLAG_NO_ENTER_ACTION)
Run Code Online (Sandbox Code Playgroud)
但是,由于某种原因,我只能获得多行或首字符大写,但不能同时获得两者。结果是键盘没有返回键,或者返回键只是在同一行中添加空格。
我是否缺少一面旗帜,或者可能使用了旧的旗帜?
编辑: 我忘了提及,我的 UI 纯粹是由代码构建的,没有 XML 布局文件。
我有一堆 json 文件,需要读取并保存为文本文件。问题是每个 json 文件中的键名不同。我已经看到使用函数 Object.keys 来获取键名,但是,例如,在这样的文件中:
{
"mainKey1" :
[
{
"subKey1" : "Value 1",
"subKey2" : "Value 2",
"subKey3" : "Value 3"
},
{
"subKey1" : "Value 1",
"subKey2" : "Value 2",
"subKey3" : "Value 3"
}
],
"mainKey2" :
[
{
"subKey1" : "Value 1",
"subKey2" : "Value 2",
"subKey3" : "Value 3"
},
{
"subKey1" : "Value 1",
"subKey2" : "Value 2",
"subKey3" : "Value 3"
}
]
}
Run Code Online (Sandbox Code Playgroud)
我如何获得名称“mainKey1”、“mainKey2”等,以及“subKey1”、subKey2”等名称。
最后,在获得这些键名后,我如何使用它们来读取对应的“Value1”、“Value2”、“Value3”。
提前致谢!
我想使用 CodePen 上发布的这个漂亮的 SVG 动画,但我不知道如何启动或重新启动动画:
https://codepen.io/elevaunt/pen/JYRBzJ
HTML
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 130.2 130.2">
<circle class="path circle" fill="none" stroke="#73AF55" stroke-width="6" stroke-miterlimit="10" cx="65.1" cy="65.1" r="62.1"/>
<polyline class="path check" fill="none" stroke="#73AF55" stroke-width="6" stroke-linecap="round" stroke-miterlimit="10" points="100.2,40.2 51.5,88.8 29.8,67.5 "/>
</svg>
<p class="success">Oh Yeah!</p>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 130.2 130.2">
<circle class="path circle" fill="none" stroke="#D06079" stroke-width="6" stroke-miterlimit="10" cx="65.1" cy="65.1" r="62.1"/>
<line class="path line" fill="none" stroke="#D06079" stroke-width="6" stroke-linecap="round" stroke-miterlimit="10" x1="34.4" y1="37.9" x2="95.8" y2="92.3"/>
<line class="path line" fill="none" stroke="#D06079" stroke-width="6" stroke-linecap="round" stroke-miterlimit="10" x1="95.8" y1="38" x2="34.4" …Run Code Online (Sandbox Code Playgroud) 此代码适用于大多数(所有?)浏览器:
myDate = new Date();
alert(myDate.toString().indexOf("("));
Run Code Online (Sandbox Code Playgroud)
但是,在VB.Net WebBrowser控件中执行时,它返回-1.
这是为什么?