Saturday, March 8, 2014

How to use EditText inside ScrollView


How to fill in the configuration file?
android: layout_height = "100dp"
android: scrollbars = "vertical">
android: layout_width = "100dp"
android: gravity = "top"
android: layout_height = "100dp"
android: id = "@ + id/myedit1"
/>


I hope the effect is the time when the input exceeds the EditText text height, there ScrollView in EditText input box<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
This requires customized, EditText not ViewGroup not add subviews.
android: layout_height = "100dp"
android: scrollbars = "vertical">
android: layout_width = "100dp"
android: gravity = "top"
android: layout_height = "100dp"
android: id = "@ + id/myedit1"
/>

In fact, wrote to achieve your purpose.











Reply:
cited a floor birdsaction reply:
this need customized, EditText not ViewGroup not add subviews.
android: layout_height = "100dp"
android: scrollbars = "vertical">
android: layout_width = "100dp"
android: gravity = "top"
android: layout_height = "100dp"
android: id = "@ + id/myedit1"
/>

In fact, wrote to achieve your purpose.



But on the phone when I reach the test purpose ah,,,,
Reply:
With android: maxLines, this effect no good?
Reply:
reference to the third floor q445697127 reply:
with android: maxLines, this effect is not it?


In EditText used: maxLines? Just tried it does not work,,,
Reply:
No one can solve it? Do not fly,,,,,,,
Reply:
android: layout_width = "100dp"
android: gravity = "top"
android: layout_height = "100dp"
android: id = "@ + id/myedit1"
/>
Do not set this height, it should be warp_content, automatically extended.

android: layout_height = "100dp"
android: scrollbars = "vertical">

You can also set the input box 100 and then, of course not scroll.


Reply:
A floor that right, not a ViewGroup subclass editText child controls can not be controlled, and scrollview can only control its subclasses, can not control a single EditText
Reply:
reference to the 7th floor lieri111 reply:
1 floor was right, editText not subclass ViewGroup child controls can not be controlled, but only their son scrollview type of control, can not control a single EditText

But I have seen successful results, ah, that is, when the contents of the input box too much inside the input box is scrollview effect ah? Is how to achieve this effect it?
Reply:
reference to the 6th floor birdsaction reply:
android: layout_width = "100dp"
android: gravity = "top"
android: layout_height = "100dp"
android: id = "@ + id/myedit1"
/>
Do not set this height, it should be warp_content, automatically extended.

android: layout_height = "100dp"
android: scrollbars = "vertical">

You can also set the input box 100 and then, of course not scroll.

ScrollView really like the effect appears after or this is a positive solution ah,,,,, I set smaller than him! ! !

Reply:
 android: layout_width = "match_parent" 
android: layout_height = "wrap_content"
android: lines = "3"
android: scrollbars = "vertical" />

No need to show scrollbar put android: scrollbars = "vertical" removed, as you can scroll.
Reply:
reference to the 10th floor tantahe reply:
 android: layout_width = "match_parent" 
android: layout_height = "wrap_content"
android: lines = "3"
android: scrollbars = "vertical" />

No need to show scrollbar put android: scrollbars = "vertical" removed, as you can scroll.


Well, you are most correct! ! ! ! Ha ha. . .

No comments:

Post a Comment