android - How can I make a TextView look like a Button? -
i have listactivity in android. each row item starts activity resource. default of course textview.
i'd (and "i'd like", mean "the client insists") textview button. if make them buttons, default list click handler doesn't work anymore - if they're non-focusable - have write code manually inflate view containing button , set click handler.
is there way instead can make textview button without of button's behaviors?
you should able set style in layout xml file.
see http://developer.android.com/reference/android/r.style.html list of built-in platform style. not sure how work, reasonably easy do. try this:
<textview android:layout_height="wrap_content" style="@android:style/widget.button" android:layout_marginright="5sp" android:text="" android:layout_width="fill_parent"></textview>
edit: issue default button style sets android:clickable
attribute. try , add android:clickable
attribute , set false:
<textview android:layout_height="wrap_content" style="@android:style/widget.button" android:layout_marginright="5sp" android:text="" android:clickable="false" android:layout_width="fill_parent"></textview>
Comments
Post a Comment