Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/svn/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何在自己的布局上画一条线?_Android_Layout - Fatal编程技术网

Android 如何在自己的布局上画一条线?

Android 如何在自己的布局上画一条线?,android,layout,Android,Layout,*这是一个继承了上一个的类,我想在第二个类中画一条线* 这是我的xml请给我建议任何想法请解决这个问题我在过去几周一直在处理它,但仍然找不到任何解决方案要在任何布局上画一条线,你必须使用画布。如果你想在你的图像上画画,只需使画布视图透明即可。当你使用它的时候,它看起来就像你在做它 我想它会起作用的。如果您想了解更多信息,请参阅 .一天前我们讨论了类似的问题:。你知道搜索吗? public class DrawView extends View implements OnTouchListen

*这是一个继承了上一个的类,我想在第二个类中画一条线*



这是我的xml请给我建议任何想法请解决这个问题我在过去几周一直在处理它,但仍然找不到任何解决方案

要在任何布局上画一条线,你必须使用画布。如果你想在你的图像上画画,只需使画布视图透明即可。当你使用它的时候,它看起来就像你在做它

我想它会起作用的。如果您想了解更多信息,请参阅
.

一天前我们讨论了类似的问题:。你知道搜索吗?
public class DrawView extends View implements OnTouchListener {
    private static final String TAG = "DrawView";

    List<Point> points = new ArrayList<Point>();
    Paint paint = new Paint();

    public DrawView(Context context) {
        super(context);.......
public class matchFun extends Activity {
DrawView drawView;


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);


       getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);

        requestWindowFeature(Window.FEATURE_NO_TITLE);

        drawView = new DrawView(this);
      //  setContentView(R.layout.matchfun);
      //  setContentView(drawView);
       drawView.setBackgroundResource(R.layout.matchfun);
        drawView.requestFocus();....
<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/widget0"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/back_lightblue"
    >

<ImageView
    android:id="@+id/widget32"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_x="4dp"
    android:layout_y="118dp" 
    android:src="@drawable/ic_launcher"
    android:onClick="buttonClickHandler"
    android:clickable="true"/>

<ImageView
    android:id="@+id/widget33"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_x="7dp"
    android:layout_y="196dp" 
    android:src="@drawable/ic_launcher"
    android:onClick="buttonClickHandler"
    android:clickable="true"/>