タグ: ios

  • iOSアプリのレイアウトの練習 – Swift

    Swiftでボタンやラベルをたくさん並べたい場合に、どのように実装するのがスマートなのか調べてみました。

    参考にさせていただいた記事はこちら。
    HOW TO ADD STACK VIEWS PROGRAMMATICALLY AND (ALMOST) AVOID AUTOLAYOUT

    ちなみにプロジェクトはSwiftUIではなくてStoryboardで作ります。

    このサンプルでは LaunchScreenの上には手動でラベルを配置しますが、Main.storyboard の上は白紙(初期状態)のままでプログラムの中でButton、Label、StackViewを動的に配置しています。

    Swiftのバージョンアップによってプロパティ名など若干手直しが必要ですが、警告の内容に沿って修正していけば大丈夫でした。

    出来上がったサンプルのスクリーンショットがこちら。

    StackViewLayout - 縦
    StackViewLayout - 横

    Storyboard上のUI配置でAutoLayoutのコツが掴めなくて苦労しているのですが、このように動的配置すればわりと簡単にできそうです。

  • スマートフォンのシェア on 2012.05.24 by IDC

    Android- and iOS-Powered Smartphones Expand Their Share of the Market in the First Quarter, According to IDC

    プレスリリースの資料がシェアできるようなので試してみました。

    Chart: Worldwide Smartphone OS Market Share, 1Q 2012Description: IDC’s Worldwide Quarterly Mobile Phone Tracker provides smart phone and feature phone market data in 54 countries by vendor, device type, air interface, operating systems and platforms, and generation. Over 20 additional technical segmentations are provided. The data is provided four times a year and includes historical and forecast trend analysis. For more information, or to subscribe to the research, please contact Kathy Nagamine at 1-650-350-6423 or knagamine@idc.com.Further detail about this tracker can be found at:http://www.idc.com/tracker/showproductinfo.jsp?prod_id=37Tags: Author: IDCcharts powered by iCharts

    ちなみに、日本語の記事はこちら。
    世界スマホ市場シェア、Androidが59%、iPhoneは23%—IDC調査