Tuesday, January 28, 2014

highly dynamic setting edittext android


            
I used setMaxLines () and setHeight, will not work, you come across someone
Reply:
Layout nothing special
android: layout_width = "fill_parent"
android: layout_height = "fill_parent"
android: layout_weight = "1.0"
android: autoText = "true"
android: capitalize = "sentences"
android: hint = "@ string / type_to_compose_text_enter_to_send"
android: textCursorDrawable = "@ null"
android: textColor = "@ android: color / black"
android: maxLines = "4"
android: nextFocusRight = "@ + id / send_button"
android: gravity = "top" />
Reply:
By LayoutParams set!
Reply:
 int newHeight = 200; 
/ / Note that here, in the end is still using ViewGroup LinearLayout or FrameLayout, mainly to see you this EditTex
/ / Controls where the layout of the parent control is what, if LinearLayout, then here he will change LinearLayout.LayoutParams
ViewGroup.LayoutParams lp = editText.getLayoutParams ();
lp.height = newHeight;
editText.setLayoutParams (lp);

Reply:
reference to the second floor fzty1126410594 reply:
can LayoutParams set!

Ah, thank you, this can be set. . I would like to ask, is there a way to get the edittext display line, because the resolution of issues to consider cell phone may not set a fixed height. . If you can set the display line will feel a little better
Reply:
reference to the third floor ncepu307 reply:
 int newHeight = 200; 
/ / Note that here, in the end is still using ViewGroup LinearLayout or FrameLayout, mainly to see you this EditTex
/ / Controls where the layout of the parent control is what, if LinearLayout, then here he will change LinearLayout.LayoutParams
ViewGroup.LayoutParams lp = editText.getLayoutParams ();
lp.height = newHeight;
editText.setLayoutParams (lp);


Ah, thank you, this can be set. . I would like to ask, is there a way to get the edittext display line, because the resolution of issues to consider cell phone may not set a fixed height. . If you can set the display line will feel a little better
Reply:
references, 5th Floor lichao6934 reply:
Quote: references to the third floor ncepu307 reply:

 int newHeight = 200; 
/ / Note that here, in the end is still using ViewGroup LinearLayout or FrameLayout, mainly to see you this EditTex
/ / Controls where the layout of the parent control is what, if LinearLayout, then here he will change LinearLayout.LayoutParams
ViewGroup.LayoutParams lp = editText.getLayoutParams ();
lp.height = newHeight;
editText.setLayoutParams (lp);


Ah, thank you, this can be set. . I would like to ask, is there a way to get the edittext display line, because the resolution of issues to consider cell phone may not set a fixed height. . If you can set the display line will feel a little better


Before you call setMaxLines, first call setSingleLine (false);
 edittext.setSingleLine (false); 
edittext.setMaxLines (2);

Reply:
reference to the 6th floor ncepu307 reply:
Quote: references, 5th Floor lichao6934 reply:

Quote: references to the third floor ncepu307 reply:

 int newHeight = 200; 
/ / Note that here, in the end is still using ViewGroup LinearLayout or FrameLayout, mainly to see you this EditTex
/ / Controls where the layout of the parent control is what, if LinearLayout, then here he will change LinearLayout.LayoutParams
ViewGroup.LayoutParams lp = editText.getLayoutParams ();
lp.height = newHeight;
editText.setLayoutParams (lp);


Ah, thank you, this can be set. . I would like to ask, is there a way to get the edittext display line, because the resolution of issues to consider cell phone may not set a fixed height. . If you can set the display line will feel a little better


Before you call setMaxLines, first call setSingleLine (false);
 edittext.setSingleLine (false); 
edittext.setMaxLines (2);


Ah did not respond, according to what you write. I do not know why online are generally written. . I put the entire parent layout posted
android: id = "@ + id / bottom_panel"
android: layout_width = "match_parent"
android: layout_height = "wrap_content"
android: orientation = "horizontal"
android: paddingBottom = "2dip"
android: paddingLeft = "5dip"
android: paddingRight = "5dip"
android: paddingTop = "5dip">
android: id = "@ + id / editor_with_counter"
android: layout_width = "wrap_content"
android: layout_height = "match_parent"
android: layout_weight = "1.0"
android: orientation = "horizontal">

android: layout_width = "fill_parent"
android: layout_height = "fill_parent"
android: layout_weight = "1.0"
android: autoText = "true"
android: capitalize = "sentences"
android: hint = "@ string / type_to_compose_text_enter_to_send"
android: textCursorDrawable = "@ null"
android: textColor = "@ android: color / black"
android: maxLines = "4"
android: nextFocusRight = "@ + id / send_button"
android: gravity = "top" />
Reply:
reference to the 7th floor lichao6934 reply:
Quote: references to the 6th floor ncepu307 reply:

Quote: references, 5th Floor lichao6934 reply:

Quote: references to the third floor ncepu307 reply:

 int newHeight = 200; 
/ / Note that here, in the end is still using ViewGroup LinearLayout or FrameLayout, mainly to see you this EditTex
/ / Controls where the layout of the parent control is what, if LinearLayout, then here he will change LinearLayout.LayoutParams
ViewGroup.LayoutParams lp = editText.getLayoutParams ();
lp.height = newHeight;
editText.setLayoutParams (lp);


Ah, thank you, this can be set. . I would like to ask, is there a way to get the edittext display line, because the resolution of issues to consider cell phone may not set a fixed height. . If you can set the display line will feel a little better


Before you call setMaxLines, first call setSingleLine (false);
 edittext.setSingleLine (false); 
edittext.setMaxLines (2);


Ah did not respond, according to what you write. I do not know why online are generally written. . I put the entire parent layout posted
android: id = "@ + id / bottom_panel"
android: layout_width = "match_parent"
android: layout_height = "wrap_content"
android: orientation = "horizontal"
android: paddingBottom = "2dip"
android: paddingLeft = "5dip"
android: paddingRight = "5dip"
android: paddingTop = "5dip">
android: id = "@ + id / editor_with_counter"
android: layout_width = "wrap_content"
android: layout_height = "match_parent"
android: layout_weight = "1.0"
android: orientation = "horizontal">

android: layout_width = "fill_parent"
android: layout_height = "fill_parent"
android: layout_weight = "1.0"
android: autoText = "true"
android: capitalize = "sentences"
android: hint = "@ string / type_to_compose_text_enter_to_send"
android: textCursorDrawable = "@ null"
android: textColor = "@ android: color / black"
android: maxLines = "4"
android: nextFocusRight = "@ + id / send_button"
android: gravity = "top" />

Oh, right
setSingleLine (false); to be placed in front of setText.
Which is the last call to setText try again
Reply:
A great relationship with the calling sequence
Reply:
reference to the 9th floor ncepu307 reply:
a great relationship with the calling sequence

Ah, yes, I'm wondering about, thank you very much

No comments:

Post a Comment