Forum Xamarin.Android

Error 1 String types not allowed (at 'gravity' with value 'bottom | center').

hi,

I have set a textview gravity with

android:gravity="bottom | center"

and VS Studio complains with the the following error when I try to compile:
Error 1 String types not allowed (at 'gravity' with value 'bottom | center').

However the designer works fine and display the text correctly at the bottom of my textview and centered!

Any idea why?

Thanks

Posts

  • CheesebaronCheesebaron DKInsider, University mod

    Try a higher target API level. Think these were introduced somewhere around API 10 or so.

  • HotBridgeHotBridge GBMember

    So there is no way to format text both bottom and center in API lvl 8? (other than programatically, overriding OnPaint() ?)

  • CheesebaronCheesebaron DKInsider, University mod

    Just set the target, not the minimum one to a higher level, and see if that works...

  • HotBridgeHotBridge GBMember

    I've tried Android 4.2 and it still does not work :-/

  • CheesebaronCheesebaron DKInsider, University mod

    It works fine here, however you need to remove the spaces between the | symbol like:

    android:layout_gravity="bottom|center"
    
  • HotBridgeHotBridge GBMember

Sign In or Register to comment.