기본 콘텐츠로 건너뛰기

iOS version check

#define SYSTEM_VERSION_EQUAL_TO ( v ) ([[[ UIDevice currentDevice ] systemVersion ] compare : v options : NSNumericSearch ] == NSOrderedSame ) #define SYSTEM_VERSION_GREATER_THAN ( v ) ([[[ UIDevice currentDevice ] systemVersion ] compare : v options : NSNumericSearch ] == NSOrderedDescending ) #define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO ( v ) ([[[ UIDevice currentDevice ] systemVersion ] compare : v options : NSNumericSearch ] != NSOrderedAscending ) #define SYSTEM_VERSION_LESS_THAN ( v ) ([[[ UIDevice currentDevice ] systemVersion ] compare : v options : NSNumericSearch ] == NSOrderedAscending ) #define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO ( v ) ([[[ UIDevice currentDevice ] systemVersion ] compare : v options : NSNumericSearch ] != NSOrderedDescending ) http://stackoverflow.com/questions/3339722/how-to-check-ios-version

Android, layout background tile

Layout layout = ... Bitmap bmp = BitmapFactory. decodeResource (getResources(), R.drawable. paper0 ); BitmapDrawable bitmapDrawable = new BitmapDrawable(getResources(),bmp); bitmapDrawable.setTileModeXY(Shader.TileMode. REPEAT , Shader.TileMode. REPEAT ); layout .setBackgroundDrawable(bitmapDrawable);

Android, simple Fragment sample

* Main ---------------------------------------------------------- ***** xml <? xml version= "1.0" encoding= "utf-8" ?> < LinearLayout xmlns: android = "http://schemas.android.com/apk/res/android" android :layout_width= "match_parent" android :layout_height= "match_parent" android :orientation= "vertical" xmlns: tools = "http://schemas.android.com/tools" > < LinearLayout android :orientation= "horizontal" android :layout_width= "match_parent" android :layout_height= "wrap_content" > < Button android :layout_width= "wrap_content" android :layout_height= "wrap_content" android :text= "fragment1" android :id= "@+id/button1" android :layout_weight= "1" android :onClick= "selectFrag" /...