This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (KeyboardType == UIKeyboardType.NumberPad) | |
{ | |
NSNotificationCenter.DefaultCenter.AddObserver ( | |
"UIKeyboardDidShowNotification", (notification) => { | |
UIButton doneButton = new UIButton(new RectangleF(0, 163, 106, 53)); //{ButtonType = UIButtonType.Custom}; | |
//doneButton.SetTitle("Done", UIControlState.Normal); | |
doneButton.SetImage(UIImage.FromFile("DoneUp.png"), UIControlState.Normal); | |
doneButton.SetImage(UIImage.FromFile("DoneDown.png"), UIControlState.Highlighted); | |
doneButton.AdjustsImageWhenHighlighted = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using MonoTouch.Foundation; | |
using MonoTouch.UIKit; | |
using MonoTouch.Dialog; | |
namespace SignalR.Client.MonoTouch.Sample | |
{ | |
[Register ("AppDelegate")] | |
public partial class AppDelegate : UIApplicationDelegate | |
{ | |
UIWindow window; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void DismissKeyboard(UIView view) | |
{ | |
if (AppManager.IsKeyboardVisible) | |
{ | |
var text = new UITextField(RectangleF.Empty); | |
view.AddSubview(text); | |
text.BecomeFirstResponder(); | |
text.ResignFirstResponder(); | |
text.RemoveFromSuperview(); | |
text.Dispose(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2015-02-16 14:24:38.950 HiJackTest[4944:2813532] Attempting to JIT compile method '(wrapper managed-to-native) System.Func`3<intptr, intptr, intptr>:wrapper_aot_native (intptr&,intptr,intptr)' while running with --aot-only. See http://docs.xamarin.com/ios/about/limitations for more information. | |
2015-02-16 14:24:39.002 HiJackTest[4944:2813532] Moving to: <UIStatusBar: 0x154854a00; frame = (0 0; 0 20); opaque = NO; layer = <CALayer: 0x17003e4c0>> | |
2015-02-16 14:24:44.716 HiJackTest[4944:2813532] Unhandled managed exception: Object reference not set to an instance of an object (System.NullReferenceException) | |
at HiJackTest.Application.MyCapture (IntPtr block, IntPtr self, IntPtr uiView) [0x00018] in /Users/dbeattie/HijackTest/HiJackTest/Main.cs:54 | |
at (wrapper native-to-managed) HiJackTest.Application:MyCapture (intptr,intptr,intptr) | |
at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr) | |
at UIKit.UIApplication.Main (System.String[] args, IntPtr principal, IntPtr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[DllImport("/usr/lib/libobjc.dylib")] | |
extern static IntPtr class_getInstanceMethod(IntPtr classHandle, IntPtr Selector); | |
[DllImport("/usr/lib/libobjc.dylib")] | |
extern static IntPtr method_getImplementation(IntPtr method); | |
[DllImport("/usr/lib/libobjc.dylib")] | |
extern static IntPtr imp_implementationWithBlock(ref BlockLiteral block); | |
[DllImport("/usr/lib/libobjc.dylib")] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.v7.widget.CardView | |
android:id="@+id/card_view_friend" | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:card_view="http://schemas.android.com/apk/res-auto" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
card_view:cardCornerRadius="4dp" | |
card_view:cardUseCompatPadding="true"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Snippet Name: iOS Utils | |
Platform: Xamarin.iOS | |
Function: Check if running iOS 8, is phone, is tall, and envoke on UI Thread | |
Snippet: | |
public static class Utils | |
{ | |
public static NSObject Invoker; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomFragmentsPresenter : MvxFragmentsPresenter | |
{ | |
public interface IMvxFragmentHostEx : IMvxFragmentHost | |
{ | |
void Close(IMvxViewModel viewModel); | |
void ChangePresentation (MvxPresentationHint hint); | |
} | |
private IMvxNavigationSerializer _serializer; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Snippet Name: InlineTableViewSource | |
Platform: iOS | |
Function: A subclass of UITableViewSource that allows you to define UITableViewDataSource and UITableViewDelegate methods inline, rather than subclassing. Lets you take advantage of closures and use tableviews where you can't create subclasses, like in Xamarin Sketches (compile and reference). | |
Funcs/Actions are prefixed with "_", feel free to alter if this disagrees with your styling guidelines. | |
Usage: | |
var cellId = new NSString("cell"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TableViewController : UITableViewController | |
{ | |
static readonly NSString CellId = new NSString ("C"); | |
readonly TableViewSource source = new TableViewSource (); | |
readonly List<string> rows = new List<string> (); | |
public override void ViewDidLoad () | |
{ | |
base.ViewDidLoad (); |