我正在使用UWP进行应用,并且只有带有strict-size的只读 TextBox 。 我想让用户只能看到并复制该框中的文本。 不幸的是,有时文本内部太长并且为了显示它我将需要在X轴上进行滚动动画。 我不知道怎么做。
我试过了: https://msdn.microsoft.com/en-us/library/cc645061%28v=vs.95%29.aspx?f=255&MSPPError=-2147217396 但我最终得到了ToolTips控件的错误,所以删除它但仍然不知道编辑什么来启用动画,当TextBox的文本太长时。
有人知道解决方案吗?
答案 0 :(得分:1)
您可以将var myArray = ["ibira", "garmin", "hide", "park", "parque", "corrida", "trote", "personal", "sports", "esportes", "health", "saúde", "academia"],
myString = "I went to the park with my garmin watch";
function anyInArray(needles, haystack) {
return needles.split(/\b\s+\b/).some(needle => haystack.indexOf(needle) > -1);
}
console.log(anyInArray(myString, myArray));
设置为自动,将height
设置为TextWrapping
,然后文本框将根据需要占用可用空间。
更好的解决方案是使用可选的TextBlock w / ScrollViewer:
Wrap
答案 1 :(得分:0)
这对我有用
<link rel="stylesheet" type="text/css" href="css/responsive-table.css"> <!-- my file is indeed called "responsive-table.css" and it is located within the CSS folder.