Amr Ibrahim
Amr Ibrahim

Reputation: 177

Xamarin programmatically change Textview.Text to a resource string

A simple android app , I tried this code to change a Textview.Text to a string in resources file, and that was my approach :

private void BtnClickMe_Click(object sender, System.EventArgs e)
    {
        TextView TxtView = FindViewById<TextView>(Resource.Id.textView1);

        TxtView.Text = "@string/SomeWord";
    }

any help!

Upvotes: 0

Views: 455

Answers (1)

Prabakaran
Prabakaran

Reputation: 599

Try this code,

text.Text = Resources.GetString(Resource.String.app_name);

Upvotes: 1

Related Questions