English 中文(简体)
Android:如何将阴道添加到碎片中?
原标题:Android: How to add a canvas into a FrameLayout?

我试图添加一个Canvas,把图像带入我的碎裂。

DrawMap.java extends View and includes my onDraw(Canvas c). First I m trying to call this method every time the onLocationChanged is called. This means that the Canvas needs to be recalled/updated. How do I do that?

这里是另一回事。 我试图把Canvas与红pic混为一谈。 下面图是:

c.drawBitmap(resizedBitmap, newX, newY, paint);

在这里,我 app倒了我的 app,应该把信 add添加到支架中:

DrawMap d = new DrawMap(this);

FrameLayout frame_map = (FrameLayout) findViewById(R.id.frame_map);
frame_map.addView(d);
setContentView(frame_map);

Im利用两种微粒分解屏幕。 左边(图)应显示地图,右边(图形)显示相关信息(可操作)。

What am I doing wrong? Thanks.

问题回答

我认为,问题在于:<条码>、定型号(范围_map);。 如果frame_map is the child of a parent view,则必须通过框架_map s parent view as the para amount for setContentView(View view);

这只是对你的法典进行模拟的推论。 因此,我要求从你错误报告中获得一些补充资料,以提供明确的解决办法。





相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签