本文整理汇总了C#中EditText.SetTextColor方法的典型用法代码示例。如果您正苦于以下问题:C# EditText.SetTextColor方法的具体用法?C# EditText.SetTextColor怎么用?C# EditText.SetTextColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EditText
的用法示例。
在下文中一共展示了EditText.SetTextColor方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StyleTextField
public static void StyleTextField( EditText textField, string placeholderText, string font, uint size )
{
textField.Background = null;
textField.SetTextColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.TextField_ActiveTextColor ) );
textField.Hint = placeholderText;
textField.SetHintTextColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.TextField_PlaceholderTextColor ) );
textField.SetTypeface( Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont( font ), TypefaceStyle.Normal );
textField.SetTextSize( Android.Util.ComplexUnitType.Dip, size );
}
示例2: InitializeVariables
private void InitializeVariables()
{
this.ActionBar.SetBackgroundDrawable (Resources.GetDrawable (Resource.Drawable.Black));
this.ActionBar.SetTitle (Resource.String.application);
loginButton = FindViewById<Button> (Resource.Id.logInButton);
username = FindViewById<EditText> (Resource.Id.usernameEntry);
password = FindViewById<EditText> (Resource.Id.passwordEntry);
username.SetBackgroundColor (Android.Graphics.Color.Orange);
username.SetTextColor (Android.Graphics.Color.White);
username.SetHintTextColor (Android.Graphics.Color.White);
password.SetBackgroundColor (Android.Graphics.Color.Orange);
password.SetTextColor (Android.Graphics.Color.White);
password.SetHintTextColor (Android.Graphics.Color.White);
}
示例3: SetTheme
public static void SetTheme(EditText editText, FlatTheme theme,
FlatUI.FlatFontFamily fontFamily, FlatUI.FlatFontWeight fontWeight, FlatUI.FlatTextAppearance textAppearance,
int style, int radius, int padding, int border)
{
float[] outerR = new float[]{radius, radius, radius, radius, radius, radius, radius, radius};
// creating normal state drawable
var normalFront = new ShapeDrawable(new RoundRectShape(outerR, null, null));
normalFront.SetPadding(padding, padding, padding, padding);
var normalBack = new ShapeDrawable(new RoundRectShape(outerR, null, null));
normalBack.SetPadding(border, border, border, border);
if (style == 0) { // flat
normalFront.Paint.Color = Color.Transparent;
normalBack.Paint.Color = theme.LightAccentColor;
editText.SetTextColor(theme.VeryLightAccentColor);
} else if (style == 1) { // box
normalFront.Paint.Color = Color.White;
normalBack.Paint.Color = theme.LightAccentColor;
editText.SetTextColor(theme.BackgroundColor);
} else if (style == 2) { // transparent
normalFront.Paint.Color = Color.Transparent;
normalBack.Paint.Color = Color.Transparent;
editText.SetTextColor(theme.BackgroundColor);
}
Drawable[] d = {normalBack, normalFront};
LayerDrawable normal = new LayerDrawable(d);
editText.SetBackgroundDrawable(normal);
editText.SetHintTextColor(theme.VeryLightAccentColor);
if (textAppearance == FlatUI.FlatTextAppearance.Dark) editText.SetTextColor(theme.DarkAccentColor);
else if (textAppearance == FlatUI.FlatTextAppearance.Light) editText.SetTextColor(theme.VeryLightAccentColor);
var typeface = FlatUI.GetFont(editText.Context, fontFamily, fontWeight);
if (typeface != null)
editText.SetTypeface(typeface, TypefaceStyle.Normal);
}
示例4: setItemLogin
public void setItemLogin(){
var txtFormat = Android.Util.ComplexUnitType.Px;
linearButtonLogin = new LinearLayout (this);
linearEditTextLogin = new LinearLayout (this);
linearTextLogin = new LinearLayout (this);
etxtUser = new EditText (this);
etxtPassword = new EditText (this);
btnLoginInto = new ImageButton (this);
txtLogin_a = new TextView (this);
txtLogin_b = new TextView (this);
txtInicioSesion = new TextView (this);
linearButtonLogin.LayoutParameters = new LinearLayout.LayoutParams (-1, LinearLayout.LayoutParams.WrapContent);
linearEditTextLogin.LayoutParameters = new LinearLayout.LayoutParams (-1, LinearLayout.LayoutParams.WrapContent);
linearTextLogin.LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent);
etxtUser.LayoutParameters = new ViewGroup.LayoutParams (Configuration.getWidth (507), Configuration.getHeight (78));
etxtPassword.LayoutParameters = new ViewGroup.LayoutParams (Configuration.getWidth (507), Configuration.getHeight (78));
linearButtonLogin.Orientation = Orientation.Horizontal;
linearButtonLogin.SetGravity (GravityFlags.Center);
linearEditTextLogin.Orientation = Orientation.Vertical;
linearEditTextLogin.SetGravity (GravityFlags.Center);
linearTextLogin.Orientation = Orientation.Vertical;
linearTextLogin.SetGravity (GravityFlags.Center);
etxtUser.Hint = " Usuario";
etxtUser.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
etxtPassword.Hint = " Contraseña";
etxtPassword.InputType = Android.Text.InputTypes.TextVariationPassword | Android.Text.InputTypes.ClassText;
etxtPassword.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
etxtPassword.InputType = InputTypes.TextVariationVisiblePassword;
txtLogin_a.Text = "FORGOT PASSWORD?";
txtLogin_a.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
txtLogin_b.Text = " CHANGE";
txtLogin_b.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
txtLogin_a.SetTextSize (txtFormat,Configuration.getHeight(30));
txtLogin_b.SetTextSize (txtFormat, Configuration.getHeight (30));
txtInicioSesion.Text = "Iniciar Sesión";
txtInicioSesion.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
txtInicioSesion.SetTextColor (Color.ParseColor("#ffffff"));
txtInicioSesion.SetTextSize (Android.Util.ComplexUnitType.Px, Configuration.getHeight (36));
btnLoginInto.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/otherlogin.png"),Configuration.getWidth (242), Configuration.getHeight (78),true));
etxtUser.SetTextColor (Color.ParseColor ("#ffffff"));
etxtPassword.SetTextColor (Color.ParseColor ("#ffffff"));
btnLoginInto.Click += delegate {
_dialog.Show();
var com = ((LoginViewModel)this.DataContext).LoginCommand;
com.Execute(null);
//AlertDialog.Builder popupBuilder = new AlertDialog.Builder(this);
};
initButtonColor (btnLoginInto);
etxtPassword.InputType = InputTypes.TextVariationVisiblePassword;
etxtPassword.TransformationMethod = Android.Text.Method.PasswordTransformationMethod.Instance;
txtLogin_a.SetTextColor (Color.ParseColor ("#ffffff"));
txtLogin_b.SetTextColor (Color.ParseColor ("#00c6ff"));
Drawable drawableEditText = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/cajatexto.png"), Configuration.getWidth(507), Configuration.getHeight(80), true));
etxtUser.SetBackgroundDrawable (drawableEditText);
etxtPassword.SetBackgroundDrawable (drawableEditText);
etxtUser.SetSingleLine (true);
etxtPassword.SetSingleLine (true);
LinearLayout space = new LinearLayout (this);
space.LayoutParameters = new LinearLayout.LayoutParams (-1, 20);
linearTextLogin.AddView (txtLogin_a);
linearTextLogin.AddView (txtLogin_b);
//.........这里部分代码省略.........
示例5: updateTextAttributes
private void updateTextAttributes(EditText title, EditText content)
{
float baseSize = Float.parseFloat(Preferences.GetString(Preferences.Key.BASE_TEXT_SIZE));
content.SetTextSize(baseSize);
title.SetTextSize(baseSize*1.3f);
title.SetTextColor(Color.Blue);
title.PaintFlags = title.PaintFlags | PaintFlags.UnderlineText;
title.SetBackgroundColor(0xffffffff);
content.SetBackgroundColor(0xffffffff);
content.SetTextColor(Color.DarkGray);
}
示例6: init
public void init(){
mainLayout = new RelativeLayout (this);
txtRegister = new TextView (this);
etxtEmail = new EditText (this);
etxtUser = new EditText (this);
etxtPassword = new EditText (this);
btnCreateAccount = new ImageButton (this);
linearButtonRegister = new LinearLayout (this);
linearRegister = new LinearLayout (this);
linearButtonRegister.LayoutParameters = new LinearLayout.LayoutParams (-1,LinearLayout.LayoutParams.WrapContent);
linearRegister.LayoutParameters = new LinearLayout.LayoutParams (-1,LinearLayout.LayoutParams.WrapContent);
linearButtonRegister.Orientation = Orientation.Horizontal;
linearRegister.Orientation = Orientation.Vertical;
linearButtonRegister.SetGravity (GravityFlags.Center);
linearRegister.SetGravity (GravityFlags.Center);
etxtUser.LayoutParameters = new ViewGroup.LayoutParams (Configuration.getWidth (507), Configuration.getHeight (78));
etxtPassword.LayoutParameters = new ViewGroup.LayoutParams (Configuration.getWidth (507), Configuration.getHeight (78));
etxtEmail.LayoutParameters = new ViewGroup.LayoutParams (Configuration.getWidth (507), Configuration.getHeight (78));
mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1, -1);
Drawable drawableBackground = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/cfondo.png"), 768, 1024, true));
mainLayout.SetBackgroundDrawable (drawableBackground);
txtRegister.Text = "Registro";
txtRegister.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
etxtUser.Hint =" Nombre de usuario";
etxtUser.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
etxtEmail.Hint = " Dirección de correo";
etxtEmail.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
etxtPassword.Hint =" Contraseña";
etxtPassword.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
Drawable drawableEditText = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/cajatexto.png"), Configuration.getWidth (507), Configuration.getHeight (80), true));
etxtUser.SetBackgroundDrawable (drawableEditText);
etxtPassword.SetBackgroundDrawable (drawableEditText);
etxtEmail.SetBackgroundDrawable (drawableEditText);
etxtUser.SetTextColor (Color.ParseColor ("#ffffff"));
etxtUser.SetSingleLine (true);
etxtPassword.SetTextColor (Color.ParseColor ("#ffffff"));
etxtPassword.SetSingleLine (true);
etxtEmail.SetTextColor (Color.ParseColor ("#ffffff"));
etxtEmail.SetSingleLine (true);
txtRegister.SetTextColor (Color.ParseColor("#ffffff"));
txtRegister.SetTextSize (Android.Util.ComplexUnitType.Px, Configuration.getHeight (40));
etxtPassword.InputType = InputTypes.TextVariationVisiblePassword;
etxtPassword.TransformationMethod = Android.Text.Method.PasswordTransformationMethod.Instance;
btnCreateAccount.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/crearcuenta.png"), Configuration.getWidth (507), Configuration.getHeight (80), true));
btnCreateAccount.Alpha = 255;
//btn.SetAlpha(255);
btnCreateAccount.SetBackgroundColor(Color.Transparent);
LinearLayout space = new LinearLayout (this);
space.LayoutParameters = new LinearLayout.LayoutParams (-1, 20);
LinearLayout space2 = new LinearLayout (this);
space2.LayoutParameters = new LinearLayout.LayoutParams (-1, 20);
linearRegister.AddView (etxtUser);
linearRegister.AddView (space);
linearRegister.AddView (etxtEmail);
linearRegister.AddView (space2);
linearRegister.AddView (etxtPassword);
linearButtonRegister.AddView (btnCreateAccount);
txtRegister.SetX (Configuration.getWidth(72)); txtRegister.SetY (Configuration.getHeight(535));
linearRegister.SetX (0); linearRegister.SetY (Configuration.getHeight(592));
linearButtonRegister.SetX (0); linearButtonRegister.SetY (Configuration.getHeight(975));
mainLayout.AddView (txtRegister);
mainLayout.AddView (linearRegister);
mainLayout.AddView (linearButtonRegister);
//string ndef = "None" ;
//string foto = "http://www.clinicatorielli.com/img/icons/no-user.png";
EditText lastName = new EditText (this);
lastName.Text = "None";
EditText url = new EditText (this);
url.Text = "http://www.clinicatorielli.com/img/icons/no-user.png";
//.........这里部分代码省略.........
示例7: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
// Create your application here
SetContentView(Resource.Layout.chatActivity);
//get intent data
toEmail = Intent.GetStringExtra("email");
toFirstName = Intent.GetStringExtra("firstName");
toLastName = Intent.GetStringExtra("lastName");
this.Title = toFirstName+" " + toLastName;
msgList = FindViewById<ListView>(Resource.Id.msg_list);
sendButton = FindViewById<Button>(Resource.Id.send_btn);
msgToSend = FindViewById<EditText>(Resource.Id.msg_edit);
msgToSend.SetTextColor(Android.Graphics.Color.Black);
msgToSend.SetTextSize(Android.Util.ComplexUnitType.Px,30);
//messages.Add(msg + "email= " + toEmail);
sendButton.Click += sendClickEvent;
msgAdapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, messages);
msgList.Adapter = msgAdapter;
ChatActivity.instance = this;
RegisterBroadcastReceiver();
updateMsgBox();
}
示例8: BuildUI
void BuildUI (Bundle savedInstanceState)
{
var hMargin = 20;
RequestWindowFeature (WindowFeatures.NoTitle);
Title = state.Service.ShareTitle;
layout = new LinearLayout (this) {
Orientation = Orientation.Vertical,
};
layout.SetBackgroundColor (Color.White);
SetContentView (layout);
//
// Toolbar
//
toolbar = new ToolbarView (this, Title);
toolbar.IsProgressing = state.IsSending;
toolbar.Clicked += (sender, args) => StartSending();
layout.AddView (toolbar);
//
// Scroll content
//
var scroller = new ScrollView (this) {
LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent) {
},
};
var scrollContent = new LinearLayout (this) {
Orientation = Orientation.Vertical,
LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent) {
},
};
scroller.ScrollbarFadingEnabled = true;
scroller.AddView (scrollContent);
layout.AddView (scroller);
//
// Account
//
var acctLabel = new TextView (this) {
Text = "From",
LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent) {
RightMargin = 12,
},
};
acctLabel.SetTextColor (Color.DarkGray);
acctLabel.SetTextSize (ComplexUnitType.Sp, LabelTextSize);
acctPicker = new TextView (this) {
Typeface = Typeface.DefaultFromStyle (TypefaceStyle.Bold),
Clickable = true,
};
acctPicker.SetTextColor (Color.Black);
acctPicker.SetTextSize (ComplexUnitType.Sp, LabelTextSize);
acctPicker.Click += PickAccount;
UpdateAccountUI ();
var acctLayout = new LinearLayout (this) {
Orientation = Orientation.Horizontal,
LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.WrapContent) {
TopMargin = 24,
LeftMargin = hMargin,
RightMargin = hMargin,
},
};
acctLayout.SetGravity (GravityFlags.Left);
acctLayout.AddView (acctLabel);
acctLayout.AddView (acctPicker);
scrollContent.AddView (acctLayout);
//
// Attachments
//
var attachLayout = new LinearLayout (this) {
Orientation = Orientation.Vertical,
Visibility = state.Item.HasAttachments ? ViewStates.Visible : ViewStates.Gone,
LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.WrapContent) {
TopMargin = 30,
LeftMargin = hMargin,
RightMargin = hMargin,
},
};
foreach (var x in state.Item.Links) {
attachLayout.AddView (new AttachmentView (this, x.AbsoluteUri));
}
foreach (var x in state.Item.Images) {
attachLayout.AddView (new AttachmentView (this, x.Filename, x.Length));
}
foreach (var x in state.Item.Files) {
attachLayout.AddView (new AttachmentView (this, x.Filename, x.Length));
}
scrollContent.AddView (attachLayout);
//
// Composer
//.........这里部分代码省略.........
示例9: SetTextColor
private static void SetTextColor(ExtendedPicker entry, EditText control)
{
control.SetTextColor(entry.TextColor.ToAndroid());
}