Skip to content

Instantly share code, notes, and snippets.

entry.KeyboardType = KeyboardType;
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);
public class AutoGrowDateElement : DateTimeElement, IElementSizing {
static NSString bkey = new NSString ("AutoGrowDateElement");
public AutoGrowDateElement (string caption, DateTime date) : base (caption, date)
{
fmt.DateStyle = NSDateFormatterStyle.Medium;
}
public override string FormatDate (DateTime dt)
{
return fmt.ToString (dt);
using System;
using System.Drawing;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace MonoTouch.UIKit {
[BaseType (typeof (UIButton))]
interface UIGlassButton {
[Export ("initWithFrame:")]
IntPtr Constructor (RectangleF frame);
using System;
using MonoTouch;
using MonoTouch.UIKit;
using System.Drawing;
using MonoTouch.Foundation;
using MonoTouch.CoreGraphics;
using MonoTouch.ObjCRuntime;
namespace iDailyBooth
using System;
using MonoTouch;
using MonoTouch.UIKit;
using System.Drawing;
using MonoTouch.Foundation;
using System.Text;
using System.IO;
namespace MRB
{
public override void Draw (RectangleF rect)
{
base.Draw(rect);
UIImage img = UIImage.FromFile("Images/navigation_background.png");
img.Draw(new RectangleF(0,0, 320,44));
}
@martinbowling
martinbowling / UITableViewCellDeleteConfirmationControlShift.cs
Created January 23, 2011 21:50
Move the UITableViewCellDeleteConfirmationControl on a UITableViewCell
public override void LayoutSubviews ()
{
// LayoutSubviews is called each time that we enter Editing Mode, So Lets Take This Opportunity To
// Show or Hide any elements we want
base.LayoutSubviews();
if (this.Editing)
{
this.DetailTextLabel.Hidden = true;
IntPtr sel = Selector.GetHandle ("description");
//IntPtr sel = Selector.GetHandle ("class");
@martinbowling
martinbowling / hasFreeSpace.cs
Created January 25, 2011 00:45
Does Drive Have Free Space?
public bool hasFreeSpace()
{
System.IO.DriveInfo[] drives = System.IO.DriveInfo.GetDrives();
foreach (System.IO.DriveInfo drive in drives) {
if (drive.Name.ToString() == "/")
{
if (drive.IsReady) {
Console.WriteLine(drive.AvailableFreeSpace);
if (drive.AvailableFreeSpace > 1000)
@martinbowling
martinbowling / iPhoneAppDirs.cs
Created January 25, 2011 00:48
iPhone Application Directory
/*
basedir/AppName.app Where the executables live. This is also the current working directory (Environment.CurrentDirectory).
basedir/Documents Where application-specific data files are stored. (This directory is backed up by iTunes.)
basedir/Library/Preferences Application-specific configuration settings. You should manage your settings using the NSUserDefaults class. (This directory is backed up by iTunes.)
basedir/Library/Caches Use this directory to store any cache data to be used across invocations of the application.
Your application is responsible for removing data files from this directory when it no longer needs them.
@martinbowling
martinbowling / Duh.cs
Created January 25, 2011 00:56
duh - placeholder
/*
basedir/AppName.app Where the executables live. This is also the current working directory (Environment.CurrentDirectory).
basedir/Documents Where application-specific data files are stored. (This directory is backed up by iTunes.)
basedir/Library/Preferences Application-specific configuration settings. You should manage your settings using the NSUserDefaults class. (This directory is backed up by iTunes.)
basedir/Library/Caches Use this directory to store any cache data to be used across invocations of the application.
Your application is responsible for removing data files from this directory when it no longer needs them.