Все вопросы: [textview]
18 вопросов
обрабатывать ссылку текстового просмотра в моем приложении для Android
В настоящее время я визуализирую ввод HTML в TextView следующим образом: tv.setText(Html.fromHtml("<a href='test'>test</a>")); Отображаемый HTML-код предоставляется мне через внешний ресурс, поэтому я не могу ничего изменить, как я буду, но я, конечно, могу внести некоторые из...
Android: TextView автоматически обрезает и заменяет последние 3 символа строки
Если String длиннее ширины TextView, он автоматически переносится на следующую строку.Я могу избежать этого, используя android:singleLine (не рекомендуется) или установив android:inputType="text". Теперь мне нужно что-то, что заменяет последние 3 символа моего String на « ... ».Поскольку я не ис...
Is there an easy way to add a border to the top and bottom of an Android View?
I have a TextView and I'd like to add a black border along its top and bottom borders. I tried adding android:drawableTop and android:drawableBottom to the TextView, but that only caused the entire view to become black. <TextView android:background="@android:color/green" android:layo...
Android: Is it possible to have different handlers for drawableLeft and the text inside a TextView?
I was wondering if it is possible to have different behavior depending on a click on the icon and the text inside a TextView... Any suggestions?
Is it possible to have multiple styles inside a TextView?
Is it possible to set multiple styles for different pieces of text inside a TextView? For instance, I am setting the text as follows: tv.setText(line1 + "\n" + line2 + "\n" + word1 + "\t" + word2 + "\t" + word3); Is it possible to have a different style for each text element? E.g., line1 bold...
Android - Handle "Enter" in an EditText
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 perfor...
android TextView: setting the background color dynamically doesn't work
Setting the background color programatically of an android TextView doesn't seem to work. I'm I missing something! TextView et = new TextView(activity); et.setText("350"); et.setBackgroundColor(R.color.white); I also have this file (colors.xml) in my res/values folder <resources> ...
Ellipsize not working for textView inside custom listView
I have a listView with custom objects defined by the xml-layout below. I want the textView with id "info" to be ellipsized on a single line, and I've tried using the attributes android:singleLine="true" android:ellipsize="end" without success. If I set the layout_width to a fixed width like ...
Android text view color doesn't change when disabled
When I call setEnabled(false) for a TextView object the text color doesn't change. I expected it will be changed to gray. If I remove the line of android:textColor in my XML file, it backs to normal. Any ideas ?
Vertical (rotated) label in Android
I need 2 ways of showing vertical label in Android: Horizontal label turned 90 degrees counterclockwise (letters on the side) Horizontal label with letters one under the other (like a store sign) Do I need to develop custom widgets for both cases (one case), can I make TextView to render tha...
Android selector & text color
I want a simple TextView to behave the way simple_list_item_1 in a ListView does. Here's the XML: <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:layout_width="fill_parent" android:gravity="center" android:focusable="tr...
How to access original activity's views from spawned background service
I have an activity called A, and on the selection of menu item 0, it spawns service B, which starts a runnable C in a new thread. I have a TextView in activity A, which I want to access in thread C. I've tried making the TextView a public static field, but that generates the following error: ...
Подсветка синтаксиса в какао TextView? Опыт? Предложения? Идеи?
Возможный дубликат: Раскраска синтаксиса для приложения Какао Меня интересует подсветка синтаксиса в Какао TextView. Я нашел несколько ресурсов: подход с гибкостью с помощью flex сопоставлен с шаблоном textStorageDidProcessEditing в TextView делегате. При таком по...
UITextView в UIAlertView (многострочный ввод)
У меня возникает пара проблем, когда я пытаюсь выделить UITextView в AlertView. Вот мой код: UIAlertView* minhaCritica = [UIAlertView new]; minhaCritica.title = @"7Arte"; [minhaCritica addButtonWithTitle:@"Cancelar"]; [minhaCritica addButtonWithTitle:@"Enviar"]; minhaCritica.message = @"Esc...
Таймер TextView для Android
В моем приложении для Android есть таймер, который измеряет, сколько времени прошло. Каждые 100 миллисекунд я обновляю свой TextView текстом вроде «Оценка: 10 Время: 100,10 секунды». Но я считаю, что TextView обновляется только первые несколько раз. Приложение по-прежнему очень отзывчиво, но ярл...
Как центрировать текст по горизонтали и вертикали в TextView?
Как центрировать текст по горизонтали и вертикали в TextView, чтобы он отображался точно посередине TextView в Android?