0

Possible Duplicate:
How to change a TextView's style at runtime

  <ListView
    android:id="@+id/listproducts"
    android:layout_below="@+id/textView1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:divider="#C8C8C8"
    android:dividerHeight="1dip" >
</ListView>

This is the code for the list i'm using. And below is the code for the text i want in my list.

<TextView
    android:id="@+id/productname"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textColor="#000"
    android:textAppearance="?android:attr/textAppearanceMedium"
    android:layout_marginLeft="10dip"
    android:layout_marginTop="25dip"
    android:layout_marginBottom="10dip"
    android:selectAllOnFocus="true"
    />

The ' android:selectAllOnFocus ' doesn't seem to work with textview, it does for a button. what should i do ?

Community
  • 1
  • 1
Chetna
  • 165
  • 1
  • 6
  • 15
  • 3
    [Here](http://stackoverflow.com/questions/4630440/how-to-change-a-textviews-style-at-runtime) you go (Java code. Scroll to first answer, second code part) – keyser May 31 '12 at 06:56
  • Thank you. i hope it will work now! – Chetna May 31 '12 at 06:59
  • nice solution ........... you can also check the list selector I am not sure but I think that also have this option... – Dheeresh Singh May 31 '12 at 07:00
  • http://stackoverflow.com/questions/4365893/how-to-change-color-of-android-list-item-on-click-or-selection – Dheeresh Singh May 31 '12 at 07:01
  • http://stackoverflow.com/questions/5789661/android-relativelayout-change-color-onclick – Dheeresh Singh May 31 '12 at 07:02
  • For changing style in TextView you can also have a look at [this](http://stackoverflow.com/questions/10649398/wants-to-have-multiple-text-display-styles-in-a-single-textview/10654254#10654254) – Imran Rana May 31 '12 at 07:55

0 Answers0