简体   繁体   English

没有布局管理器的Android Studio

[英]Android Studio without layout manager

I need to be able to make an app that looks like this , but all of the layout managers get in the way. 我需要能够制作一个像这样的应用程序,但是所有的布局管理器都会妨碍您。 I either can't be precise enough with placing the numbers, or relative layout moves the other numbers out of place when I move one. 我要么放置数字不够精确,要么在我移动一个数字时相对布局将其他数字移到其他位置。 What I want to know is if it's possible to not use any of the layout managers, and if so, how to do that 我想知道的是,是否有可能不使用任何布局管理器,如果可以,怎么做

You could create a custom View: 您可以创建一个自定义视图:

public class CustomView extends View { ... }

You can then draw anything you want on its canvas in the onDraw method. 然后,您可以在onDraw方法中在画布上绘制任何想要的东西。 Then View can can be used like any other View from an Activity or a Fragment. 然后,可以将View用作Activity或Fragment中的任何其他View。

onCreateView(...) {
    return CustomView();
}

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

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