first question here.
I am trying to develop an application using Xamarin and the target android from C #. My problem starts when I create an instance of TextView and try to manipulate it with code:
text = new TextView(context); text.LayoutParameters = new GridView.LayoutParams(hwidth, hheight); text.SetPadding(8, 8, 8, 8);
now I am reading the Android API and I need to change the gravity of this Textview so that the text is in the center, but when I try:
text.setGravity(Gravity.CENTER);
These are just errors saying that Android.Widget.TextView does not contain a definition for 'setGravity'. Am I missing something ridiculously simple or what?
All help appreciated!
source share