I implemented bottom tabs in my application. One of the activities has an EditText at the middle of the screen. Pressing that field causes the screen with tabs to be pushed up. Now I fixed the layout by adding the following code to the manifest file:
android:windowSoftInputMode="adjustPan|adjustResize"
But this causes the whole activity to be fixed. Is there a way I can fix the tabs but push the activity inside it upwards for the keyboard?
Part of the Manifest File:
android:name="com.betaclassapps.ghadinews.GhadiNewsTabActivity"
android:label="#string/app_name"
android:windowSoftInputMode="adjustPan|adjustResize"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Related
I am using android.support.constraint.ConstraintLayoutwith four EditText and one Button. When clicked on First Edittext, SoftInput Keyboard visible then EditText and Button Hidden.
I tried in ManiFeast.xml
android:windowSoftInputMode="adjustResize"
android:windowSoftInputMode="adjustPan"
android:windowSoftInputMode="adjustResize|stateVisible"
But did work.
Any suggestion to make screen scrollable when not using ScrollView
its my Manifest.xml Activity tag
<application
.
.
.
<activity android:name=".MainActivity"
android:windowSoftInputMode="adjustResize|stateVisible"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
There is no way to tell when the keyboard is showing. So what you want isn't possible. What you can do is stick the whole thing in a ScrollView so its always scrollable. Then it will still be scrollable when the keyboard is up.
I'm new in Android and want to know why my app deisgn isn't same as what i deisgn in Android studio. Here is the image link:
1.Why on the top banner will appear "INC AIO" string? Is this related to the layout?How to remove?
2.Why the login button will locating too close with the password text field, not like my design?
Hope can get help frpm here. Thanks.
This is ActionBar, u can remove it, here is answer how.
U need to show us your layout file (.xml)
In AndroidManifest.xml you need to add theme inside your activity tag... to remove action bar from top.
just add this code: android:theme="#style/Theme.AppCompat.NoActionBar"
with no action bar.
example:
<activity
android:name="com.example.MainActivity"
android:label="#string/app_name"
android:theme="#style/Theme.AppCompat.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
In my application Preference Setting Activity is not showing correctly sometimes. It goes black.
My Original Preference Activity
But sometimes it goes black and shows as below screenshot
no check boxes and list preference are visible.
When it goes black and I scroll It looks very poor
The Declaration in Manifest file
<activity
android:name="com.test.wallpaper.PreferenceSettingActivity"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
You have need to set Background for parent layout in this xml page.
Use setbackground for parent layout in xml.
I am having an android app developed and the developer sent me the .APK file so I can test the first version. I have successfully installed the .APK file on my Android device. However, when I run it, the app shows the name of each activity (with the app's logo) at the top, as shown in the following link http://www.quickid.net/activity.JPG (StackOverflow won't let me post images without a level 10 reputation). The left picture shows the MainActivity, and the right picture shows the startTrail activity. So, what's up with that? Is it some kind of test mode? How can I run the app as it would normally be run as if it were downloaded from the Play store, without it showing the activity names at the top? Also, when the app puts text in the notification bar, it says "Rolling text on statusbar" before showing the text.
That is the ActionBar, if the developer does not want to use it, he must change the default theme to Theme.Holo.NoActionBar or another that hides the action bar.
At the top of most activities is the activity's label. This is set in the App Manifest (AndroidManifest.xml). In <activity> you can add the attribute android:label.
By default it looks so:
<activity android:name=".Activity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
If you want to change the label, add a String value, and put this to android:label. If you want no label, add android:theme="#android:style/Theme.NoTitleBar". So it looks like this:
<activity android:name=".Activity"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
I have a NavigationDawer with some fragments which contain EditTexts. When I 'open' the fragment, the layout is fine (ie. not squashed) but when I bring the keyboard up, the layout becomes squashed.
I searched around and added this to the manifest:
<activity
android:name=".Navigation_Drawer"
android:label="#string/app_name"
android:windowSoftInputMode="adjustResize" > // This being the important part
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Because the Navigation Drawer is the only activity that contains/starts these fragments, the fragment's softInputMode should be controlled by the activity, but this code does not make any difference
Thank you
Remove the code:
android:windowSoftInputMode="adjustResize"
from manifest file.
Have you tried setting the windowSoftInputMode to adjustPan?
adjustResize will resize the activity to allow room for the keyboard, which is the behaviour you are experiencing. If you set the windowSoftInputMode to adjustPan, the activity will be be 'panned', or moved upwards to make room for the keyboard.
android:windowSoftInputMode="adjustPan"