【发布时间】:2012-02-17 03:14:09
【问题描述】:
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"/>
这是我的 xml 请建议我任何想法,请解决这个问题,我从过去几周开始一直在努力解决这个问题,但仍然找不到任何解决方案
【问题讨论】:
-
我们一天前讨论过类似的问题:stackoverflow.com/questions/9296712/…。你了解搜索吗?