android-edittext

Make editText hint italic?

邮差的信 提交于 2019-12-23 17:17:11
问题 How do you do this in xml, can you? I see this in a related question for the java code to do it, check length is 0 and: EditText.setText(Html.fromHtml("<small><i>" + "Text Hint Here" + "</i></small>")); But can you just do it from xml? EDIT: <EditText android:id="@+id/term_entry" android:layout_width="500dp" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_toRightOf="@+id/scrllyout" android:imeOptions="actionNone|flagNoExtractUi" android:inputType=

How do I inherit from default Android style in my custom styles.xml?

穿精又带淫゛_ 提交于 2019-12-23 16:34:32
问题 I am currently using this custom styles layout for my EditTexts defined in 'styles.xml': <style name="Form_EditView"> <item name="android:textColor">@color/white</item> <item name="android:textSize">@dimen/large_text_size</item> <item name="colorControlNormal">@color/white</item> <item name="colorControlActivated">@color/pink</item> <item name="colorControlHighlight">@color/pink</item> </style> However now my dilemma occurs as I have a TextView that I would like to be styled like a default

how to allow only specific number in edittext?

删除回忆录丶 提交于 2019-12-23 15:50:31
问题 am trying to put only a specific value in my edit text. I have used this this my layout. android:digits="0123468" however, i also do not want that number 1 and 3 should work in my edit text. Sample; enter 32... it gives me a list of items but enter 3 should not allow me to do something. Can someone help me on this? 回答1: This could be an aproach: <EditText android:id="@+id/edtNumber" android:digits="0123456789" android:inputType="number" /> And if you want to discard '1' and '3' you could get

How to draw lines in Android Edit Text?

本小妞迷上赌 提交于 2019-12-23 15:34:39
问题 I am trying to build a notepad application. I want to have lines in the Edit Text view of my application which is a multi line Edit Text. Please let me know how to do this. Thank you for your time and advice. 回答1: check this out.notepad 回答2: I think you are best of just showing a background, not 'drawing lines'. Use the default background a View has: http://developer.android.com/reference/android/view/View.html#setBackgroundResource(int) 回答3: Since the size of the notepad will vary based upon

how to remove a string from arraylist of strings, ANDROID

心已入冬 提交于 2019-12-23 15:11:49
问题 I created an arraylist of strings List<String> textArray = new ArrayList<String>(); and then I added the strings(which I am getting from edittext) to textArray as follows String text = editText1.getText().toString(); textArray.add(text); Now I created a button and need to remove the string from the array when the button is clicked.But i dont know what to do. I know for arrays of bitmaps we clear a bitmap from array using recycle but Please suggest me how to remove or clear the string from

Problems intercepting space key in EditText

风格不统一 提交于 2019-12-23 12:47:56
问题 I'm attempting to make a way for a user to input text into a TextView from an EditText. However, if the user enters something, and wants to fix it, I want them to be able to press space on an empty EditText to get the last thing they wrote back. The first problem is, if they type in "hello", hit enter to add it to the TextView (which clears it from the EditText), then hit space, the EditText then has " hello". Not what I want, and I can't figure out why. My code to place the entered text into

Allow EditText to Scroll while Disabled

梦想的初衷 提交于 2019-12-23 11:55:53
问题 I have an EditText set up as follows: <ScrollView android:layout_width="match_parent" android:layout_height="wrap_content" > <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:descendantFocusability="beforeDescendants" android:focusableInTouchMode="true" android:orientation="vertical" > <EditText android:layout_width="match_parent" android:layout_height="375dp" android:ems="10" android:gravity="top"> </EditText> <Button android:layout_width="match

Is there any way to programatically select text in a TextView?

情到浓时终转凉″ 提交于 2019-12-23 10:58:30
问题 I have a TextView that I'm looking to allow the user to search in for a specific string. If the string is found, it should highlight. Using a background span is too slow and awkward, so I am trying to figure out if I can just have it select the string. I know with EditText this would be possible using setSelection() , but I don't want the user to be able to edit the text, while still being able to manually highlight text, which I can't seem to do manage with an EditText . I guess, then it's

how to set cursor background transparent for EditText Android

血红的双手。 提交于 2019-12-23 10:49:14
问题 I'm having this issue when I touch an EditText for changing text on Android: A white frame appears around the red cursor, and I need it to be transparent for showing properly the line of the EditText. How do I change this? code: <EditText android:id="@+id/login_user_name_text" android:textCursorDrawable="@null" android:layout_width="match_parent" android:layout_height="wrap_content" android:textColor="@color/black" android:textSize="16sp" android:inputType="textEmailAddress" android

how to set cursor background transparent for EditText Android

送分小仙女□ 提交于 2019-12-23 10:49:02
问题 I'm having this issue when I touch an EditText for changing text on Android: A white frame appears around the red cursor, and I need it to be transparent for showing properly the line of the EditText. How do I change this? code: <EditText android:id="@+id/login_user_name_text" android:textCursorDrawable="@null" android:layout_width="match_parent" android:layout_height="wrap_content" android:textColor="@color/black" android:textSize="16sp" android:inputType="textEmailAddress" android