1

Suppose I create a custom class MyView that extends android.widget.RelativeLayout. Then I create an xml file that uses MyView

<com.myapp.MyView 
   xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="match_parent" 
   android:layout_height="wrap_content"
   android:longClickable="true"/>

I noticed that when I was writing the xml file, I couldn't get code hinting or completion that I would have expected from Eclipse due to inheritance from RelativeLayout. Is this normal? I experimented with creating a styleable to see if that would help Eclipse connect the dots. I set the parent attribute to the RelativeLayout styleable found in the SDK's attrs.xml (code below). This didn't have any effect. It seems Eclipse isn't aware of styleables other than the ones in the SDK. Is this correct?

<resources>
   <declare-styleable
      name="MyView" 
      parent="@android:style/RelativeLayout"/>
</resources>

Thanks much!

Julian A.
  • 10,928
  • 16
  • 67
  • 107

1 Answers1

0

Discovered this used to be an issue before ADT 12, when it was fixed. I was using ADT 15 but still had the problem because I was editing the layout for the custom class using Eclipse's XML editor, not the Android layout editor.

Similar question posted.

Community
  • 1
  • 1
Julian A.
  • 10,928
  • 16
  • 67
  • 107