Bất cứ khi nào tôi có Chế độ xem bên trong một ViewGroup
bên trong một android.support.v4.widget.DrawerLayout
, tính năng tự động hoàn thành của Eclipse bắt đầu hoạt động lạ. Nó không hiển thị hầu hết các thuộc tínhHỗ trợ nội dung Eclipse không hoạt động đúng cách cho bố cục Android
Ví dụ với DrawerLayout -> LinearLayout -> ImageView:
Trong ảnh chụp màn hình trước đó, bạn có thể thấy rằng tôi gõ "android:scale
..." và IntelliSense của IDE không hiển thị cho tôi của android:scaleType
Nếu tôi sử dụng cửa sổ Properties của Eclipse cho ImageView
, tôi có thể thấy rằng nó chỉ được hiển thị các thuộc tính cơ bản cho "View
" ImageView (và không cho ImageView
...):
Bây giờ nếu ImageView không phải là một hậu duệ của DrawerLayout và tôi đặt nó ở một nơi khác, autocomplete hoạt động đúng:
Tôi đã đã xem các câu hỏi có liên quan như:
nhưng họ đã chết không có câu trả lời cho khá trong một ...
Nội dung hỗ trợ không làm việc cho xem (có thể là TextView, EditText, Buttons .. .) mà tôi thêm vào trong DrawerLayout. Nó chỉ gợi ý các thuộc tính 'cơ bản'.
Có ai biết tại sao điều này xảy ra hoặc cách sửa lỗi này?
bố trí mẫu:
<?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>
Khi sử dụng gói hỗ trợ Widget này là một tình huống phổ biến - http: // stackoverflow.com/questions/22537733/no-layout-width-attribute-được hiển thị-trong-tùy chọn-danh sách-khi-sử dụng-drawerlayout-in-adt –