[UWP]当屏幕分辨率为1920 * 1080时,边框厚度未正确应用 [英] [UWP]Border Thickness is not applied properly when screen resolution is 1920*1080
问题描述
如果我将TextBox的边框粗细设置为0.4以下,则当屏幕分辨率为1920 * 1080时,边框不可见。
如果分辨率为1366 * 768,则可正常工作。
< TextBox Name =" textBox1"了borderThickness = QUOT; 0.2" />
请您仔细研究并提供解决方案吗?
Hello Priya VR,
您是否尝试为TextBox设置BorderBrush以查看是否可以在那个分辨率中看到它?
< TextBox Name =" textBox1"了borderThickness = QUOT; 0.2" BorderBrush = QUOT;红色" />我认为这很正常。它实际上是可见的,只是由于高分辨率,你的眼睛无法区分它。
我建议你可以根据当前的屏幕分辨率改变BorderThickness。请参考以下代码以供参考:
var bounds = ApplicationView.GetForCurrentView()。VisibleBounds;
var scaleFactor = DisplayInformation.GetForCurrentView()。RawPixelsPerViewPixel;
var size = new Size(bounds.Width * scaleFactor,bounds.Height * scaleFactor);
请阅读粘贴帖子,尤其是
发布指南:主题行标签和
Windows 10 SDK和工具的已知问题
请记得自己为标题添加标签。
最好的问候,
Xavier Eoro
If I set TextBox's border thickness below 0.4, border is not visible when screen resolution is 1920*1080.
It works correctly if the resolution is 1366 * 768.
<TextBox Name="textBox1" BorderThickness="0.2" />
Could you please look into this and provide the solution to overcome?
Hello Priya VR,
Have you tried to set BorderBrush for TextBox to see if you can see it in that resolution?
<TextBox Name="textBox1" BorderThickness="0.2" BorderBrush="Red" />I think it’s normal. It’s actually visible, just due to the high resolution, your eyes cannot distinguish it.
I would suggest you could change BorderThickness according to current screen resolution. Please refer to the following code for reference:
var bounds = ApplicationView.GetForCurrentView().VisibleBounds; var scaleFactor = DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel; var size = new Size(bounds.Width * scaleFactor, bounds.Height * scaleFactor);
In addition, Welcome to the Developing Universal Windows apps forum!
Please read the sticky posts, especially the Guide to posting: subject line tags and Known Issues for Windows 10 SDK and Tools
Please remember to add tag to title yourself.
Best Regards,
Xavier Eoro
这篇关于[UWP]当屏幕分辨率为1920 * 1080时,边框厚度未正确应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!