Android full screen edittext is not working.

Asked 2 years ago, Updated 2 years ago, 31 views

<application
    android:name=".CustomStartApp"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name">

    <activity android:name=".MainActivity"
        android:theme="@style/MyAppTheme">
   </activity>

This is a manifest file.

<style name="MyAppTheme" parent="@android:style/Theme.DeviceDefault.Light">
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowFullscreen">true</item>
    <item name="windowActionBar">true</item>
</style>

This is a style file.

<EditText
    android:id="@+id/edit_text"
    android:gravity="top"
    android:layout_below="@id/realtive"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginTop="10dp"
    android:background="@android:drawable/edit_text"/>

Edit Text Properties

This prevents edittext from working as shown below. I can't even see it because it's big, and when I click it, the keyboard doesn't pop up and there's no response I don't know what to do.

.

android

2022-09-22 21:10

2 Answers

There seems to be no reason why EditText won't work just because it's a full screen, but it's strange. You defined the theme as below in the style code you uploaded, is there a reason?

parent="@android:style/Theme.DeviceDefault.Light"

Change it to a common and commonly used theme and test it.

parent="Theme.AppCompat.Light.DarkActionBar"

Additionally, it would be better to check if the cursor is visible and the keyboard is working properly when it is not a full screen.


2022-09-22 21:10

It's working well with the following attributes on edittext android:focusable="true" android:focusableInTouchMode="true"


2022-09-22 21:10

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.