简体   繁体   中英

Button didn't change its size based on the screen resolution

How can I make my Windows Store App look great on large resolutions? For example a Button - how can I change its font size based on the resolution? If I view my app on 13" the button looks OK, but if I view it on 27" display it looks very, very small. Isn't something to be used in the Windows store apps framework to adapt a button, textBlock, etc to the screen resolution?

ViewBox设置StretchDirection="Both"StretchProperty="Fill"

This is a consequence of screen scaling based on DPI... which makes your button the same physical size on both monitors, but totally ignores the fact that the user sits/stands much closer to one than the other. Maybe someday we'll have a not-stupid scaling scheme that works based on subtended angles.

Large format monitors already have larger pixels, I suggest you simply opt out of display scaling in your application. (But do respect the global system font size settings)

I'm not sure what the opt-out setting is in XAML (WPF), but in WinForms, I'd be changing the AutoScaleMode property.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM