每当我在android.support.v4.widget.DrawerLayout
内的ViewGroup
内有Views时,Eclipse的自动完成开始奇怪。它不DrawerLayout显示大多数的属性Eclipse内容辅助工具无法正常工作Android布局
示例 - >的LinearLayout - > ImageView的:
在前面的屏幕截图,你可以看到我输入 “android:scale
...” 和IDE的智能感知不显示我的ImageView android:scaleType
如果我使用Eclipse的属性窗口ImageView
,我可以看到,它只是为“View
”显示基本属性(而不是为ImageView
...):
现在,如果ImageView的不是DrawerLayout的后裔,我把它放在别的地方,自动完成正常工作:
我已经看过相关的问题如:
,但他们都已经死了,没有答案了好一阵子......
内容助攻次数不工作(无论是TextViews,EditText上,按钮.. )我在DrawerLayout中添加。它只提示'基本'属性。
有没有人知道为什么会发生这种情况或如何解决这个问题?
样品布局:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/some_image" />
</LinearLayout>
<RelativeLayout
android:id="@+id/drawer_view"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start" >
</RelativeLayout>
</android.support.v4.widget.DrawerLayout>
当使用支持包Widgets时,这是一个常见的场景 - http:// stackoverflow。COM /问题/ 22537733 /无布局宽度属性示出的 - 在选项一览时-使用-drawerlayout合ADT –