Text Size
Tuesday, December 23, 2014

IOS and LAMP Web Developer Blog by Mike Zriel

IOS Xcode

IOS Xcode

Last Updated on Saturday, 06 September 2014 10:49

orientation uiview full screen

BY: Mike Zriel

Set View to full screen.

    UIView *view = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    UIInterfaceOrientation interfaceOrientation = [[UIApplication sharedApplication] statusBarOrientation];
    if (interfaceOrientation == UIInterfaceOrientationLandscapeRight||interfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
        view.frame = CGRectMake(0, 0, CGRectGetHeight(view.frame), CGRectGetWidth(view.frame));
    }
 
IOS Xcode

IOS Xcode

Last Updated on Thursday, 21 August 2014 14:38

Xcode force 24 hour clock on NSDate

BY: Mike Zriel

Force 24 hour close on NSData set the NSDateFormatter to the following:

NSLocale *enUSPOSIXLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"];
[formatter setLocale:enUSPOSIXLocale];

Example:

formatter = [[NSDateFormatter alloc] init];
NSTimeZone *timeZone = [NSTimeZone timeZoneWithName:@"UTC"];
NSLocale *enUSPOSIXLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"];
[formatter setLocale:enUSPOSIXLocale];
[formatter setTimeZone:timeZone];
[formatter setLenient: YES];
[formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];

NSLog("Date : %@",[formatter stringFromDate:[NSDate date]]);
 
Java Android

Java Android

Last Updated on Wednesday, 23 July 2014 07:36

How to create a custom button in Android

BY: Mike Zriel

To create an custom button in Android create a subfolder called drawable in the res directory.

Then create an xml file save is as custom_button.xml or what ever you chose to name it.

below is content for your custom button

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle" 
    android:typeface="monospace">

    <solid android:color="#00ff00" />

    <corners
        android:bottomLeftRadius="7dp"
        android:bottomRightRadius="7dp"
        android:topLeftRadius="7dp"
        android:topRightRadius="7dp" />
    <stroke
        android:width="1dp"
        android:color="#ff0000" />

</shape>

solid sets the hex color of the button, corners set the corner radius ( rounded corders ), stroke set a border color for the button.

 
Copyright © 2014 by Mike Zriel - Zriel.com