顯示具有 iOS & Android 標籤的文章。 顯示所有文章
顯示具有 iOS & Android 標籤的文章。 顯示所有文章

2013年10月23日 星期三

iOS和Android的UI元件比較

reference:  http://kintek.com.au/blog/portkit-ux-metaphor-equivalents-for-ios-and-android/

顯示loading:
iOS:          UIActivityIndicatorView
Android:   ProgressDialog

開關:
iOS:          UISwitch
Android:   ToggleButton

iOS和Android的文字輸入UI元件比較

提示文字:
iOS :  textField.placeholder = @"test";
Android:   android:hint="輸入食物名稱"    ( xml)


密碼:
iOS :         textField.secureTextEntry = YES;
Android:   android:inputType="textPassword"   (xml)              

2013年10月15日 星期二

iOS和Android的UI設計比較

設定透明顏色
iOS:             view.backgroundColor = [UIColor clearColor];
Android:      view.setBackgroundColor(Color.TRANSPARENT);

文字和邊界間距:
iOS:
Android: android:paddingLeft="6dp"

2013年8月28日 星期三

Objective-C和Java基本功能比較

宣告物件變數
Objective-C:  Baby  *cuteBaby;
Java:   Baby  cuteBaby;
差異:  星字號

建立物件
Objective-C:  Baby  *cuteBaby = [[Baby alloc] initWithAge:3];
Java:  Baby cuteBaby = new Baby(10);

for loop
Objective-C:
for(NSString *str in array)
Java:
for (String str : array)

array
Objective-C:  NSMutableArray
NSMutableArray *array = [[NSMutableArray alloc] init];
array.count;
Java:  ArrayList
ArrayList list = new ArrayList();
list.size();

dic
Objective-C:  NSMutableDictionary
Java: HashMap
HashMap dic = new HaspMap();
dic.put("Peter", new Double(3434.34));


空物件
Objective-C:  nil
Java:  null

array使用
    array裡物件的數量
         Objective-C:  array.count
         Java:  array.size()



2013年8月15日 星期四

iOS和Android的列印訊息比較

列印:
iOS:
    void NSLog(NSString *format, ...);
Android:
    android.util.Log的 public static int d(String tag, String msg);
    說明: 之後看log時可查詢特定tag的訊息

ex:
iOS:
    NSLog(@"Peter Pan");
Android:
    Log.d("MainActivity", "onStart() called");
    說明: Android可設定Log level



輸出:
iOS:
     直接印在console
Android:
     從LogCat