SlidingDrawer with rotation

MikiWattsMikiWatts ILMember
edited October 2012 in Xamarin.Android

I'm trying to create a sliding drawer that will come from the top to the bottom, rather than bottom to top. I've seen people mention using the xml attribute of rotation with 180, but there doesn't seem to be support for it with Mono for Android.

Is there something like that for a sliding drawer ? or optionally, how can I replicate the animation of the sliding drawer ?

Best Answer

  • JonathanPryorJonathanPryor US Xamurai
    Accepted Answer

    The problem is that android:rotation XML attribute calls the View.setRotation method/View.Rotation property, which was added in API 11. Consequently, your $(TargetFrameworkVersion) needs to be set for API 11 or later.

    Edit your Project Options/Properties and set the Target framework to Honeycomb or later.

Answers

  • JonathanPryorJonathanPryor USXamarin Team Xamurai

    Which attribute are you trying to use? If Android supports an XML attribute, you should be able to use it with Mono for Android.

  • MikiWattsMikiWatts ILMember

    As far as I could see from other posts, it was called just rotation. If I try to add it to the sliding drawer, I get "No resource identifier found for attribute 'rotation' in package 'android'" when building in Visual Studio.

    Here is an answer that claims to work, though I'm not sure if it's for iOS or Android
    http://stackoverflow.com/a/11228364/16172

    in my case, the axml was given a namespace of p1, rather than android (<RelativeLayout xmlns:p1="http://schemas.android.com/apk/res/android"), but I don't think it should matter ?

  • JonathanPryorJonathanPryor USXamarin Team Xamurai
    Accepted Answer

    The problem is that android:rotation XML attribute calls the View.setRotation method/View.Rotation property, which was added in API 11. Consequently, your $(TargetFrameworkVersion) needs to be set for API 11 or later.

    Edit your Project Options/Properties and set the Target framework to Honeycomb or later.

  • MikiWattsMikiWatts ILMember

    You're right, I thought I had it set to API 16, but it was indeed set on v2.2 which is API 8. After changing it, it accepted the setting.
    I'm surprised I managed to do anything with API 8 :)

    Thanks for the help.

Sign In or Register to comment.