android - Automatic horizontal scroll in textview with layout_weight -
i have been looking @ other threads couldn't find answer here comes question:
is possible create automatically horizontal scrolling textview button right of using layout_weight?
"my incredibly long search text here" "the button"
i have tried make scrollable textview "fill_parent" instead of 0dp , layout_weight entire text takes "row" (obviously since fill_parent) , button not shown , text didn't scroll horizontally when ran in android virtual device.
edit: forgot write how tried make scrollable textview
<textview android:singleline="true" android:scrollhorizontally="true" android:ellipsize="marquee" android:marqueerepeatlimit="marquee_forever" android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/searchresult" android:focusable="true" android:focusableintouchmode="true"/>
of course it's possible. do:
<linearlayout android:layout_widht="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <textview android:layout_width="0px" android:layout_weight="7" .../> <button android:layout_width="0px" android:layout_weight="3" ... /> </linearlayout> key here make width 0 there's horizontal space remaining when weight mechanism assigns remaining space linear layout components in relation layout weight.
Comments
Post a Comment