wxr
2023-07-25 8309664bc53f72b0c808c339329cabcee87657c5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;
using AVFoundation;
using CoreGraphics;
using Foundation;
using UIKit;
 
namespace Shared
{
    public class BaseViewController : UIViewController
    {
        public BaseViewController() : base() { }
        public BaseViewController(IntPtr intPtr) : base(intPtr) { }
 
        public static MediaPlayer.MPVolumeView MPVolumeView
        {
            internal set;
            get;
        }
        public override void ViewDidLoad()
        {
            Instance = this;
            base.ViewDidLoad();
            var mainUIView = new UIView(new CoreGraphics.CGRect(0, 0, View.Frame.Width, View.Frame.Height));
            View.AddSubview(mainUIView);
            Application.RootFrameLayout = mainUIView;
 
            if (Application.IsMusicEnable)
            {
                MPVolumeView = new MediaPlayer.MPVolumeView(new CoreGraphics.CGRect(-100, -100, 0, 0)) { Hidden = false };
                View.AddSubview(MPVolumeView);
            }
        }
        public static BaseViewController Instance;
 
        public override void DidReceiveMemoryWarning()
        {
            base.DidReceiveMemoryWarning();
            // Release any cached data, images, etc that aren't in use.
        }
 
    }
}