| | |
| | | }; |
| | | contentView.AddChidren(mesView); |
| | | |
| | | Button btnMes = new Button() |
| | | TextButton btnMes = new TextButton() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = mesView.Width, |
| | | Height = mesView.Height, |
| | | //Height = mesView.Height, |
| | | Height = Application.GetRealWidth(20), |
| | | TextAlignment = TextAlignment.TopLeft, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | IsMoreLines = true, |
| | | Text = msgStr, |
| | | //BackgroundColor = CSS_Color.AuxiliaryColor2 |
| | | |
| | | }; |
| | | mesView.AddChidren(btnMes); |
| | | //动态计算高度 |
| | | var needHeight = btnMes.GetMoreLineNeedHeight(); |
| | | btnMes.IsMoreLines = true; |
| | | btnMes.Height = needHeight; |
| | | |
| | | Button btnLine = new Button() |
| | | { |