2017年4月28日金曜日

IE11でブランクに下線がつかない問題の解決

IE11で<u>□□□□□□</u>(□は、スペースです)と書くと、下線が描かれない。
それを解決するCSS

u {
text-decoration: underline;
white-space: pre;
}

参考
http://stackoverflow.com/questions/4513388/how-to-underline-blank-space-in-css

2017年4月21日金曜日

2017年4月12日水曜日


親要素の幅に収まるようにフォントサイズを変更する
https://hail2u.net/blog/coding/resize-text-based-on-content-width.html

display:noneの要素にターゲットの幅よりも大きなサイズで入れておき、
ターゲットの幅より小さくなるまでフォントサイズを1pxずつ引いていく手法。

ネットワークがつながるまで繰り返す


Phonegap Network Connection - Cannot read property 'type' of undefined
http://stackoverflow.com/questions/25672502/phonegap-network-connection-cannot-read-property-type-of-undefined

Androidのエミュレータ環境だと、起動後すぐにアプリが開くので、
ネットワークにつながっていない状態の場合、情報取得などがうまくいかないです。

setTimeoutで500ms程度待つという解決法があったのですが、稀にまだつながっていない場合があったので、
ネットワークを認識するまでsetIntervalでループさせる方法を実装しました
(ある程度のリトライでエラー表示をさせるなどの処理が必要になりそうですが)。

------
  console.log('networkState => ' + navigator.connection.type);
  var connectionDetect = setInterval(function(){
      console.log(navigator.connection.type)
      if(navigator.connection.type != undefined && navigator.connection.type != 'none'){
        clearInterval(connectionDetect);
        console.log('networkState => ' + navigator.connection.type);
        //つながったときの処理
      }
  }, 500);

2017年4月3日月曜日

iOSの"done"などを英語から日本語に

http://shake-yama.blogspot.jp/2015/07/cfbundledevelopmentregionjapanese.html

Target設定のInfoタブ内、Custom iOS Target Properties(appName.plist)に
Localization native development region を Japaneseに変更で日本語に変わりました
(Japanとポップアップに出ますが、それでは日本語化されません)