有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java如何从其他类的编辑文本中使用自定义值在画布中绘制矩形

我需要画布自定义视图的帮助。 我需要使用用户提供的自定义值绘制建筑图

提供的信息类别:

et1 = findViewById(R.id.editTextNumberDecimalTest3);
et2 = findViewById(R.id.editTextNumberDecimal2);

enter image description here

帆布画

 protected void onDraw (Canvas canvas)
    {
        mRectSquare.top = 100;
        mRectSquare.left = 100;
        mRectSquare.right = mRectSquare.left + 500;
        mRectSquare.bottom = mRectSquare.top + 200;

        setBackgroundColor(Color.TRANSPARENT);
        canvas.drawRect(mRectSquare, mPaintSquare);
    }

enter image description here

我需要将数据从“Et1”发送到“mRectSquare.right”,以创建化妆室大小 但是我不能使用intent,因为类扩展视图不能使用GetIntent。 有什么想法吗


共 (0) 个答案