Android app in Eclipse: Edit text not showing on Graphical layout

后端 未结 6 1223
醉话见心
醉话见心 2020-11-27 13:53

I am trying to add a text field onto my Android app in Eclipse, but then I drag the Plain text option on to the graphical layout, a message at the bottom comes

相关标签:
6条回答
  • 2020-11-27 14:30

    The W in Android 4.4W suggest wearable devices. Android Wear is a wrist watch and you cannot type anything in it so you cannot use EditText on 4.4W. Change the API to 19 or less or change it to 4.4L

    Check it out @ https://developer.android.com/design/wear/index.html

    You can change your previewing API version as Jim suggested if u don't want to develop apps for wearable devices.

    0 讨论(0)
  • 2020-11-27 14:40

    If you are facing this on Android Studio, follow along

    1) Uninstall Android 4.4W(API 20) from the SDK Manager

    2) Make sure you have Android SDK Build Tools 19.1 installed from the SDK Manager.

    3) Edit build.gradle within your app folder. Set the following two values as below

    compileSdkVersion 19
    buildToolsVersion "19.1"
    

    4) The IDE will prompt you to sync the Gradle file with your project, click Yes.

    5) Open your activity file and then change the 'Android version to use when rendering layouts in IDE' to 'API 19'. This is the green colored Android Bot towards the right on the preview window

    0 讨论(0)
  • 2020-11-27 14:44

    Check the "Android version to use when rendering layouts" and make sure you're not using a version that ends in "W" for Android Wear (e.g. API 20: Android 4.4W). I don't believe Wear supports EditText.

    In both Android Studio and Eclipse, it's the dropdown with the green android in the layout preview's toolbar. You may want to set it explicitly and not allow the IDE to choose the Android version automatically.

    0 讨论(0)
  • 2020-11-27 14:44

    I deleted 4.4w from my sdk install pile, which must have slipped past me last time I installed an sdk. Once I removed it it was no longer and option, and eclipse picked an sdk I did have that wasn't W and it worked.

    0 讨论(0)
  • 2020-11-27 14:46

    I changed my Android version for Android 4.2, but it still not work for me. I tried different solutions found that it only work by deleting Android 4.4W package.

    Window > Android SDK Manager > check Android 4.4W(API 20) if it was installed > Delete package

    0 讨论(0)
  • 2020-11-27 14:47

    From the Eclipse IDE, just change the API version to use for previewing, as shown in below screenshot. Instead of "Automatically Pick Best", manually select the one which works for you (API 17 worked for me).

    enter image description here

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