发现 developer.android.com 官网的错误,更新中

网页:http://developer.android.com/guide/topics/ui/custom-components.html

 

 

Modifying an Existing View Type

 写道
If you haven't done so already, import the NotePad sample into Eclipse (or just look at the source using the link provided). In particular look at the definition of MyEditText in the NoteEditor.java file.
 

 

 

在 NoteEditor.java 里面已经没有 MyEditText ,而是 LinedEditText

 

 

--------------------我是分隔线----------下面是另一个错误地方--------------

 

网址:http://developer.android.com/guide/topics/ui/binding.html

 

Filling the Layout with Data

 

Cursor cur = managedQuery(People.CONTENT_URI, PROJECTION, null, null);

 参数少了一个, 应该是:

Cursor cur = managedQuery(People.CONTENT_URI, PROJECTION, null, null,null);写道

 

--------------------我是分隔线----------下面是另一个错误地方--------------

网址:http://developer.android.com/guide/topics/resources/animation-resource.html

 

Property Animation

 

<objectAnimator
            android:propertyName="x"
            android:duration="500"
            android:valueTo="400"
            android:valueType="intType"/>
        <objectAnimator
            android:propertyName="y"
            android:duration="500"
            android:valueTo="300"
            android:valueType="intType"/>

 这里不可以设置  android:valueType="intType" ,否则会报错误:

 

 

Couldn't find setter/getter for property x with value type int
 

还有:

AnimatorSet set = (AnimatorSet) AnimatorInflater.loadAnimator(myContext,
    R.anim.property_animator);
set.setTarget(myObject);
set.start();

 这里应该是  R.animator.property_animator);

 

 

还有:

API Demos for examples on how to use the property animation system.

 

这里的链接也是错的。http://zoso:8080/resources/samples/ApiDemos/src/com/example/android/apis/animation/index.html

 

 

--------------------我是分隔线----------下面是另一个错误地方--------------

 

网页地址: http://developer.android.com/guide/topics/ui/drag-drop.html

 

 

Designing a Drag and Drop Operation

 

Starting a drag

第一步:

 

ClipData dragData = new ClipData(v.getTag(),ClipData.MIMETYPE_TEXT_PLAIN,item);

 

ClipData类没有MIMETYPE_TEXT_PLAIN这个属性;

而是在ClipDescription类中

所以正确的用法是:

 

ClipData dragData = new ClipData((CharSequence)v.getTag(),new String[] {ClipDescription.MIMETYPE_TEXT_PLAIN},item);

 

--------------------我是分隔线----------下面是另一个错误地方--------------

-----下面错误就有点低级了-------

 

 

Responding to drag events: an example

 

case DragEvent.ACTION_DRAG_ENTERED: {

                // Applies a green tint to the View. Return true; the return value is ignored.

                v.setColorFilter(Color.GREEN);

                // Invalidate the view to force a redraw in the new tint
                v.invalidate();

                return(true);

                break;

 看到了吗? return 之后再 break。 编译都不通过。 不知道这章的代码有没有真正的实验过。

 

你可能感兴趣的:(android,developer,官网错误)