scif_yar: (Default)
[personal profile] scif_yar
Вот есть у вас текста кусок:

TableRow
android:background="#cccccc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scrollIndicators="start|right|end"
android:layout_margin="2dp"
>

[Error: Irreparable invalid markup ('<textview [...] <b>') in entry. Owner must fix manually. Raw contents below.]

Вот есть у вас текста кусок:
<cut>
TableRow
android:background="#cccccc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scrollIndicators="start|right|end"
android:layout_margin="2dp"
>

<TextView
android:id="@+id/about2"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="123456"
android:background="#E0FFFF"
<b> android:clickable="true"
android:onClick="onClick_testchange_textcolor"
</b> />

/TableRow
<hr>
окей. И функция, простая:
public void onClick_testchange_textcolor(View view) {
// тестирование смены цветов. По онклик
// http://developer.alexanderklimov.ru/android/views/textview.php
// http://developer.alexanderklimov.ru/android/trafficlights.php
TextView change_color = (TextView)findViewById(R.id.about2);
String change_color_onclick = "строка для смены текста";

change_color.setText(change_color_onclick);
}

Все отлично, все збс. Ну, кроме того что не цвет текста меняется, а сам текст.

Теперь вторая часть. Есть 300 (триста) таких текстовых полей, и у каждого свой id - в данном примере - about2

Значит, надо в каждый формируемый текствью вписать android:clickable="true
и собсно вызов функции, да еще этот ID передать в нее как параметр.
ОхЪ наплакаюсь.


</cut>

Profile

scif_yar: (Default)
scif_yar

December 2025

S M T W T F S
 123456
78910111213
14151617181920
21222324252627
28 293031   

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 25th, 2026 07:39 pm
Powered by Dreamwidth Studios