本文整理汇总了C#中Android.Widget.TextView.SetMaxWidth方法的典型用法代码示例。如果您正苦于以下问题:C# TextView.SetMaxWidth方法的具体用法?C# TextView.SetMaxWidth怎么用?C# TextView.SetMaxWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Android.Widget.TextView
的用法示例。
在下文中一共展示了TextView.SetMaxWidth方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ini
public void ini(){
var textFormat = Android.Util.ComplexUnitType.Px;
mainLayout = new RelativeLayout (context);
mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1,-1);
contenLayout = new LinearLayout (context);
contenLayout.LayoutParameters = new LinearLayout.LayoutParams (-2, -2);
contenLayout.Orientation = Orientation.Vertical;
//LIST
contentListLayout = new LinearLayout (context);
contentListLayout.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth(583),Configuration.getHeight(300));
contentListLayout.Orientation = Orientation.Vertical;
titleHeaderList = new TextView (context);
contentList = new ListView (context);
//titleHeaderList.Text = "Tipos de Aves";
titleHeaderList.SetTextColor (Color.ParseColor ("#FF0080"));
titleHeaderList.SetTextSize (textFormat, Configuration.getHeight (38));
titleHeaderList.SetMaxWidth (Configuration.getWidth (510));
contentListLayout.SetBackgroundResource (Resource.Drawable.border);
contentListLayout.AddView (titleHeaderList);
contentListLayout.AddView (contentList);
contentListLayout.SetX (Configuration.getHeight (25));
//contentListLayout.SetY (Configuration.getWidth (450));
//ENDLIST
imBorderList = new ImageView (context);
mainLayout.AddView (contentListLayout);
}
示例2: ini
public void ini(){
var textFormat = Android.Util.ComplexUnitType.Px;
mainLayout = new RelativeLayout (context);
mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1,-1);
contenLayout = new LinearLayout (context);
contenLayout.LayoutParameters = new LinearLayout.LayoutParams (-2, -2);
contenLayout.Orientation = Orientation.Vertical;
titleHeader = new TextView (context);
content = new TextView (context);
titleHeader.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf");
content.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf");
//titleHeader.Text = "El Perú cuenta con mas de 357000 tipos de aves";
titleHeader.SetTypeface(null,TypefaceStyle.Bold);
titleHeader.SetTextSize (textFormat, Configuration.getHeight (52));
titleHeader.SetMaxWidth (Configuration.getWidth (583));
//content.Text = "Los factores geográficos, climáticos y evolutivos convierten al Perú en el mejor lugar para realizar la observacion de aves(birthwaching) Tiene 1830 especies de pájaros(segun la lista oficial del SACC/CRAP), tambien es considerado el";
content.SetTextSize (textFormat, Configuration.getHeight (26));
content.SetMaxWidth (Configuration.getWidth(583));
contenLayout.AddView (titleHeader);
contenLayout.AddView(content);
//contenLayout.SetX (Configuration.getHeight (45));
int padW = Configuration.getWidth(45);
int padH = Configuration.getHeight (15);
//contenLayout.SetPadding (padW,padH,padW,padH);
//contenLayout.SetY (Configuration.getWidth (12));
mainLayout.SetPadding (padW,padH,padW,padH);
mainLayout.AddView(contenLayout);
}
示例3: ini
public void ini(){
var textFormat = Android.Util.ComplexUnitType.Px;
var textFormatdip = Android.Util.ComplexUnitType.Dip;
mainLayout = new RelativeLayout (context);
mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1,-1);
mainLinearLayout = new LinearLayout (context);
headerLinearLayout = new LinearLayout (context);
contentLinearLayout = new LinearLayout (context);
mainHeaderLinearLayout = new LinearLayout (context);
imHeader = new ImageView (context);
titleHeader = new TextView (context);
AutorHeader = new TextView (context);
content = new TextView (context);
titleHeader.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf");
AutorHeader.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf");
content.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf");
mainLinearLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
mainHeaderLinearLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(125));
contentLinearLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
headerLinearLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, -1);
mainLinearLayout.Orientation = Orientation.Vertical;
mainHeaderLinearLayout.Orientation = Orientation.Horizontal;
headerLinearLayout.Orientation = Orientation.Vertical;
contentLinearLayout.Orientation = Orientation.Vertical;
mainLinearLayout.AddView (mainHeaderLinearLayout);
mainLinearLayout.AddView (contentLinearLayout);
mainHeaderLinearLayout.AddView (imHeader);
mainHeaderLinearLayout.AddView (headerLinearLayout);
headerLinearLayout.AddView (titleHeader);
headerLinearLayout.AddView (AutorHeader);
headerLinearLayout.SetPadding (15, 0, 0, 10);
AutorHeader.SetPadding (0, 15, 0, 0);
contentLinearLayout.AddView (content);
contentLinearLayout.SetPadding (0, 15, 0, 0);
mainLinearLayout.SetBackgroundResource (Resource.Drawable.border);
// mainLinearLayout.SetX (Configuration.getHeight (45));
//mainLinearLayout.SetY (Configuration.getWidth (500));
//titleHeader.Text = "Diferentes tipos de aves en Perú";
titleHeader.SetTextColor (Color.ParseColor ("#FF0080"));
//titleHeader.SetTextSize (textFormat, Configuration.getHeight (38));
titleHeader.SetTextSize (textFormatdip, 16.0f);
titleHeader.SetMaxWidth (Configuration.getWidth (274));
titleHeader.SetMaxHeight (Configuration.getHeight (80));
//titleHeader.SetX (Configuration.getHeight (218));titleHeader.SetY (Configuration.getWidth (794-desviacion));
titleHeader.Ellipsize = TextUtils.TruncateAt.End;
titleHeader.SetMaxLines(2);
//AutorHeader.Text = "Autor del Articulo";
AutorHeader.SetTextColor(Color.ParseColor ("#424242"));
AutorHeader.SetTextSize (textFormat, Configuration.getHeight (23));
AutorHeader.SetMaxWidth (Configuration.getWidth (274));
//AutorHeader.SetMaxHeight (Configuration.getHeight (25));
//AutorHeader.SetX (Configuration.getHeight (218));AutorHeader.SetY (Configuration.getWidth (895-desviacion));
AutorHeader.Ellipsize = TextUtils.TruncateAt.End;
AutorHeader.SetMaxLines(1);
//content.Text = "Los factores geográficos, climáticos y evolutivos convierten al Perú en el mejor lugar para realizar la observacion de aves(birthwaching) Tiene 1830 especies de";
//content.SetTextSize (textFormat, Configuration.getHeight (24));
content.SetTextSize (textFormatdip, 12.0f);
content.SetMaxWidth (Configuration.getWidth(501));
//content.SetX (Configuration.getHeight (68));content.SetY (Configuration.getWidth (951-desviacion));
//content.Ellipsize = TextUtils.TruncateAt.End;
//content.SetMaxLines(4);
//imHeader.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/user.png"),Configuration.getWidth (124), Configuration.getHeight (124),true));
//imHeader.SetX (Configuration.getHeight (68));imHeader.SetY (Configuration.getWidth (792-desviacion));
imHeader.SetMaxWidth (Configuration.getWidth (124));
imHeader.SetMaxHeight (Configuration.getWidth (124));
int padW = Configuration.getWidth(45);
int padH = Configuration.getHeight (15);
mainLayout.SetPadding (padW,padH,padW,padH);
//.........这里部分代码省略.........