Debugging with the Debugger在eclipse中设置断点,需要在
application android:icon="@drawable/icon"
android:label="@string/app_name"
android:debuggable="true">
Then, simply right-click the project, and select Debug As > Android
Application.
————————————————————————————————————
先用xml定义sharp drawable对象
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#FFFFFF"
android:endColor="#808080"
android:angle="270" />
</shape>
然后有两种方法调用该对象
1 android:background=attribute
2 call the Canvas.setBackgroundResource( ) method in the view’s
onCreate( ) method like this:
setBackgroundResource(R.drawable.background);
如图效果