Quantcast
Channel: sprouthead blog » Xcode
Viewing all articles
Browse latest Browse all 3

PhoneGapで長押しした場合のテキスト選択を無効にする

$
0
0

PhoneGapで作成したiPhoneアプリのプロジェクトで、長押しした場合のテキスト選択はCSSに下記を記述することで無効にできます。


* {
-webkit-touch-callout: none;
-webkit-user-select: none;
}

PhoneGapでプロジェクトを作成した場合にできるwww/css/index.cssでは下記のようにbodyに対して記述されてるのですが、これだとうまくいかないことがある為、*に対して記述します。


* {
-webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */
}

body {
-webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */
-webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */
-webkit-user-select: none; /* prevent copy paste, to allow, change 'none' to 'text' */
background-color:#E4E4E4;


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images