JohnHardman

Badges

Third Anniversary500 Likes2500 Comments250 Answers250 LikesSecond Anniversary100 Answers1000 Comments50 Answers100 Likes25 Answers500 CommentsFirst Anniversary25 Likes5 Answers100 CommentsFirst AnswerPhotogenic5 Likes10 CommentsName DropperFirst Comment

About

Username
JohnHardman
Location
GB
Joined
Visits
4,117
Last Active
Roles
University
Points
4,228
LinkedIn URL
www.linkedin.com/in/johnshardman
Badges
22

JohnHardman ✭✭✭✭✭

About

Username
JohnHardman
Location
GB
Joined
Visits
4,117
Last Active
Roles
University
Points
4,228
LinkedIn URL
www.linkedin.com/in/johnshardman
Badges
22
  • Re: Interface with XAML or c #, one or the other or both.

    @Dev_Jr2018 - You can build a UI in C# (I've done it), but for the vast majority of apps you should really be doing it in XAML. Unless there are particular reasons to use C#, you will actually save yourself time and effort by using XAML. Some things are definitely easier in XAML (e.g. bindings), and you will spend less time looking for memory leaks if using XAML. Plus, if working in a development team, you are more likely to have a dedicated UI designer, who is more likely to be able to work with XAML than C#.

  • Re: Content Page Secondary Toolbar Items in iOS same as Android

    @AmitManchanda - To get the dropdown menu to re-position when the orientation changes basically needs that same childRect/table.Frame code in public override void ViewDidLayoutSubviews()

  • Re: Which is the proper way of validations of forms?

  • Re: Removing shadow from android buttons

    @twine - You haven't shown enough code to point out what is failing.

    Here's what I do (using XF 2.4.0). There are two themes (MainTheme and Theme.Splash) to support the splash screen mechanism described by @AdamP at xamarinhelp.com

      <style name="MainTheme" parent="MainTheme.Base">
        <!--All sorts of other stuff here-->
      </style>
    
      <style name="Theme.Splash" parent="MainTheme.Base">
        <!--All sorts of other stuff here-->
      </style>
    
      <style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
        <item name="android:buttonStyle">@style/NoShadowButton</item>
        <!--All sorts of other stuff here-->
      </style>
    
      <style name="NoShadowButton" parent="android:style/Widget.Button">
        <item name="android:stateListAnimator">@null</item>
      </style>
    

    The splash theme is specified in the metadata for MainActivity:

        [Activity(
            ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize,
            Icon = "@drawable/launchericon",
            Label = "MyApp",
            LaunchMode = LaunchMode.SingleTop,
            MainLauncher = true,
            ScreenOrientation = ScreenOrientation.FullSensor,
            Theme = "@style/Theme.Splash")]
        public class MainActivity : FormsAppCompatActivity
    

    And the main theme is specified in the OnCreate override:

            public override void OnCreate(Bundle bundle, PersistableBundle persistentState)
            {
                Window.RequestFeature(WindowFeatures.ActionBar);
                SetTheme(Resource.Style.MainTheme);
                // other stuff here
            }
    

    @ClintStLaurent is trying to get you to work this out for yourself, as it's the best way of learning. I normally do the same as @ClintStLaurent in this respect and wouldn't normally shortcut @ClintStLaurent 's guiding. However, I'm going to give you this one (sorry Clint), because it's so refreshing to see somebody write "I am also not looking for 'just use TapGestureRecognizers', i'd like to use buttons". 100% agree with you on that.

  • Re: Android Launch Screen size

    @stesvis - See https://xamarinhelp.com/creating-splash-screen-xamarin-forms/ (particularly the Better Approach section)