Android: Eclipse autocomplete does not work in xml files

前端 未结 4 1023
执笔经年
执笔经年 2020-12-10 03:02

I am seeing a strange problem with my Eclipse IDE for Android development.

Autocompletion does not work when I hit Ctrl + Space in the main.xml file for my layouts.

相关标签:
4条回答
  • 2020-12-10 03:02

    It seems like an eclipse XML editor issue. If you declare the xmlns in other than "xmlns:android" you loose the autocompletion.

    for example if you say:

     xmlns:android="http://schemas.android.com/apk/res/android"
    android:.... //AUTOCOMPLETES
    

    if you say

     xmlns:android1="http://schemas.android.com/apk/res/android"
    android1:... //DOES NOT AUTOCOMPLETE
    
    0 讨论(0)
  • 2020-12-10 03:06

    Try this as suggested powder366

    Or you can set the default editor in Eclipse Preferences, used Android Common XML Editor. You find it in Eclipse Preferences, General, Editors, File Associations. Click on .xml, choose "Add" "Android Common XML Editor". Select it and press the Default button.

    0 讨论(0)
  • 2020-12-10 03:17

    Check that the file is being opened in the Android XML Layout editor (not just the "plain" XML editor). Right-click the file, choose Open With, and select Android Layout Editor.

    0 讨论(0)
  • 2020-12-10 03:24

    Open eclipse and go to the following:

    Window > preferences > XML > editor > content assist > advanced
    

    Select all checkboxes and click ok. After that, restart eclipse.

    0 讨论(0)
提交回复
热议问题