Monday, April 14, 2014

Layout MutilineText controls put height settings? ? ?


posts by CCDDzclxy edited 2013-09-22 19:26:26
RT

Environment: Eclipse + Win7

After the following, shown in Figure 1, MutilineText onto the screen, after setting properties Lines and Gravity, is this:
Here Fig 1:



Then I want to get a bit of height MutilineText high, as shown below 2:
Below is a diagram 2:




MutilineText attributes as:
 
android: id = "@ + id / etMsg"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: layout_alignParentLeft = "true"
android: layout_alignParentRight = "true"
android: layout_marginTop = "150dp"
android: gravity = "center_vertical | top"
android: inputType = "textMultiLine"
android: lines = "50">





The question is:
I did like Figure 2 pulled, release the mouse, the height and retracted go (back to figure 1), how not tow the line ...
Then, I also tried directly set android: XXX property values, but the effect is not right ...

In the end how to set up, allowing MutilineText becomes a little higher, it will not back out? ? ?


N engage in a long time, sick ......................



<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
android: layout_height = "wrap_content" means to adapt to the height of the control, you have a few lines of text, the controls on the corresponding display tall.
Want to fill the screen can be used android: layout_height = "match_parent" or similar android: layout_height = "300dp", how high you want you can define your own
Reply:
cited a floor tantahe reply:
android: layout_height = "wrap_content" means to adapt to the height of the control, you have a few lines of text, the controls on the corresponding Show how much.
Want to fill the screen can be used android: layout_height = "match_parent" or similar android: layout_height = "300dp", how high you want you can define your own

Useless, or even set up something else? ?
Reply:
cited a floor tantahe reply:
android: layout_height = "wrap_content" means to adapt to the height of the control, you have a few lines of text, the controls on the corresponding Show how much.
Want to fill the screen can be used android: layout_height = "match_parent" or similar android: layout_height = "300dp", how high you want you can define your own

The complete xml stickers out
Reply:
reference to the third floor tantahe reply:
Quote: references to a floor tantahe reply:

android: layout_height = "wrap_content" means to adapt to the height of the control, you have a few lines of text, the controls on the corresponding display tall.
Want to fill the screen can be used android: layout_height = "match_parent" or similar android: layout_height = "300dp", how high you want you can define your own

The complete xml stickers out

 
xmlns: tools = "http://schemas.android.com/tools"
android: layout_width = "match_parent"
android: layout_height = "300dp"
android: layoutMode = "clipBounds"
android: paddingBottom = "@ dimen / activity_vertical_margin"
android: paddingLeft = "@ dimen / activity_horizontal_margin"
android: paddingRight = "@ dimen / activity_horizontal_margin"
android: paddingTop = "@ dimen / activity_vertical_margin"
tools: context = ". MainActivity">


Reply:
Bottom and the main window looks on, as shown below:

I will MutilineText drag down the overall time, there will be such a sentence "android: layout_alignParentBottom =" prompt in true "", but I see the emergence of a horizontal line at the red arrow, I can not drag that will MutilineText The following lines of ...
Area below the horizontal piece so wasted?
Reply:
Feel these interface design for developers is also very troublesome
Reply:
RelativeLayout height before 300dp, EditText of marginTop there 150dp, plus the above Button and TextView to the rest of the space is not 150dp ah.
You should RelativeLayout in android: layout_height = "match_parent". EditText's android: layout_height also changed "match_parent".
Reply:
Horizontal piece is highly 300dp RelativeLayout limit, so you RelativeLayout where all the controls are unlikely to exceed that line.
Reply:
reference to the 8th floor tantahe reply:
piece dash is highly 300dp RelativeLayout limit, so you RelativeLayout where all the controls are unlikely to exceed that line .

RelativeLayout's layout_height really is the reason, it may be time to set other attributes, mistakes RelativeLayout set of layout_height ...

No comments:

Post a Comment