android-edittext

This view is not constrained vertically. At runtime it will jump to the left unless you add a vertical constraint

邮差的信 提交于 2019-12-28 05:05:36
问题 New Layout editor in Android Studio 2.2 keeps showing this error on views like EditText and Buttons. kindly help.Also, any links that help in onboarding with the new constraint layout would be appreciated. code: <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout android:id="@+id/activity_main" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android

Android, how do I stop a pointer appearing below an EditText

点点圈 提交于 2019-12-28 04:32:05
问题 I have an activity with some EditTexts in it. When I click on an EditText to change the text in it a blue arrow appears below where the cursor appears. How can I stop this appearing? 回答1: As MarvinLabs pointed out, it's a set of drawables in the Android SDK. They can be overridden though. Find these images in your sdk platform: text_select_handle_left.png text_select_handle_middle.png text_select_handle_right.png Copy them over to your drawables folder, so you have a local copy to reference.

Android Labels or Bubbles in EditText

纵饮孤独 提交于 2019-12-28 03:17:09
问题 Can someone please point me in the right direction how to do those bubbles or labels in the EditText something like those you see when you want to compose something in Stream for Google+ when you add a circle or contact? The Rectangle is an auto complete edittext. 回答1: What you are showing is the same behavior as the SMS stock application. Search for the code here to see how it's done. EDIT: The code should be in platform_packages_apps_mms. Take a look at the RecipientsEditor class. 回答2: I

How to exclude special characters from android keypad for EditText

感情迁移 提交于 2019-12-28 03:07:29
问题 Hi I want to show only numbers and characters on the keypad for EditText in android, I did try to add the attribute android:inputType = text|number but it did not work. Please help me with any other better suggestion. thanks in advance. 回答1: try to add the digits parameter to your editText: android:digits="abcde.....012345789" 回答2: Use the filter for that. Here I am adding the code for filter. EditText etName = (EditText)findViewById(R.id.etName); InputFilter filter = new InputFilter() {

Scrolling EditText inside ScrollView

无人久伴 提交于 2019-12-28 01:11:38
问题 I have a nasty problem. I have EditText (8 lines) inside ScrollView . And when I'm trying to scroll text in EditText it's behavior is not stable. Sometimes it's scrolling, some times it's not taking focus. This is my layout file, to make my question more clear: <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="8dp" > <TextView android:id="@+id/wo_task_name" android:layout_width="wrap_content" android:layout

How to use EditText onTextChanged event when I press the number?

半世苍凉 提交于 2019-12-27 23:41:12
问题 I have an EditText with "text = 0.00" . When I press the number 3, it should be like 0.03 and the second time when I press the number 5, the text should be 0.35 . And 35.0 , 35.09 like this. The EditText initially has the value of 0.00 . These are all done with the same EditText . How do I achieve this? I have tried using addTextChangedListener() with TextWatcher() . 回答1: You have selected correct approach. You have to extend the class with TextWatcher and override afterTextChanged() ,

EditText loses content on scroll in ListView?

百般思念 提交于 2019-12-27 17:41:06
问题 I have list item with EditText in it, I don't know how many items there will be. I have a problem when I enter some text in EditText , and then scroll down a ListView , after I've scroll up again there is no text in my first EditText , or there is some text from other EditText from ListView . I've tried TextWatcher , and saving data to array, but problems is that returned position of view in ListView isn't always right, so I lost some data from array. Here is my code: public class

Android - Handle “Enter” in an EditText

寵の児 提交于 2019-12-27 09:03:13
问题 I am wondering if there is a way to handle the user pressing Enter while typing in an EditText , something like the onSubmit HTML event. Also wondering if there is a way to manipulate the virtual keyboard in such a way that the "Done" button is labeled something else (for example "Go") and performs a certain action when clicked (again, like onSubmit). 回答1: I am wondering if there is a way to handle the user pressing Enter while typing in an EditText, something like the onSubmit HTML event.

Android - Handle “Enter” in an EditText

删除回忆录丶 提交于 2019-12-27 09:02:38
问题 I am wondering if there is a way to handle the user pressing Enter while typing in an EditText , something like the onSubmit HTML event. Also wondering if there is a way to manipulate the virtual keyboard in such a way that the "Done" button is labeled something else (for example "Go") and performs a certain action when clicked (again, like onSubmit). 回答1: I am wondering if there is a way to handle the user pressing Enter while typing in an EditText, something like the onSubmit HTML event.

Calculating percentages value of edittext in android

笑着哭i 提交于 2019-12-26 23:46:12
问题 I have got the code to add the values of multiple edittext fields and display the total in one field. Now I need to include the percentage calculation of two more edittext fields along with the total value. editTexts = new EditText[] {monthly_rent_et, water_et,eb_et,sewage_et,maint_et,others_et,sec_deposit_et}; for (int i=0 ; i<editTexts.length ; i++) { editTexts[i].setOnFocusChangeListener(mFocusChangeListener); } private View.OnFocusChangeListener mFocusChangeListener = new View