简体   繁体   English

如何在 Android Studio 的每台设备上使视图大小相同

[英]How to make view size the same on every device on Android studio

Im making a collaborative drawing app but I can't get painting view/ canvas to be the same size on each device.我正在制作一个协作绘图应用程序,但我无法在每个设备上获得相同大小的绘画视图/画布。 How can I fix this?我怎样才能解决这个问题? here are screenshots of the app on 2 different android phones App screenshots这是该应用程序在 2 款不同的 Android 手机上的屏幕截图 应用程序屏幕截图

你可以试试这个代码

canvasid.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使每个设备上的位图大小和位置相同 - Make bitmap size and position the same on every device 如何进行布局,使Cardview与每个Android屏幕尺寸的设备兼容? - How to make a layout, with cardviews compatible for every android screen size device? 如何确保每个Android设备中的速度与Android游戏相同? - How to make sure the speed in every android device is same for an android game? 使每个设备的图像视图看起来都一样 - Make an image view look the same in every device 如何使View的大小与我自定义的TextureVIew Android的大小相同 - How to make the size of View the same as the size of my custom TextureVIew Android 如何使小部件调整它们的大小以在每台设备上看起来都一样? - How can I make widgets adjust their size to look the same on every device? Android:如何在实际设备上制作一个模拟器? - Android: How to make an emulator in size of a real device? 如何在任何屏幕尺寸上始终以相同的比例显示Android View的位置和尺寸? - How can I make Android View position and size be shown always with the same proportion on any screen size? 如何在Android Studio中为每个设备设置标准布局 - How can I set a standard layout for every device in android studio 在每个移动设备上强制使用相同的字体大小 - force same font size on every mobile device
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM