[Silverlight] 當麻許的Phone7筆記 - 8.輸入的鍵盤設定(InputScope)
2010/12/27
上次討論了關於 裝置方向(Device Orientation) 今天來談談有關於輸入的鍵盤設定
剛拿到從設計用 Expression Blend 這邊做好的Project ,
可以直接使用Microsoft Visual Studio 2010 打開,當執行的時候發現了一件事情,再輸入小費的時候,
會跳出來的鍵盤,並不是真的是數字用的鍵盤而是英文字母
此時需要注意的,要做出一隻貼心又利於使用者好用的APP 這是要注意的細節,所以呢我們要稍微修改一下bill 那一個TextBox 的XAML Property :
修改前:
<TextBox x:Name="txtBill" TextWrapping="Wrap" Text=" 0.00" BorderBrush="{x:Null}" Foreground="White" SelectionBackground="{x:Null}" Style="{StaticResource TextBoxStyle1}" SelectionForeground="#FFF09609" Background="#FFF09609"/>
修改後:
<TextBox x:Name="txtBill" TextWrapping="Wrap" Text=" 0.00" BorderBrush="{x:Null}" Foreground="White" SelectionBackground="{x:Null}" Style="{StaticResource TextBoxStyle1}" SelectionForeground="#FFF09609" Background="#FFF09609" InputScope="TelephoneAreaCode" />
其中增加的Property 就是 InputScope="TelephoneAreaCode"
這樣預設的鍵盤就會改變成是輸入數字的鍵盤

如果是透過C# 的程式來設定 InputScope 的方法
txtBill.InputScope = new InputScope()
{
Names = { new InputScopeName() { NameValue = InputScopeNameValue.TelephoneAreaCode } }
};
其實一定有人很好奇的問,
明明就有 InputScopeNameValue.Number 為什麼不用呢?!
那是因為其實 InputScopeNameValue.Number 這鍵盤是長這樣:

對於使用者來說,似乎 InputScopeNameValue.TelephoneAreaCode 會更貼近使用者的使用習慣,
雖然這是小小的地方,但是對於使用者來說是非常貼心的。
順帶一提的..在Visual Studio 中有看到 intelligent sense 竟然有一個輸入鍵盤是

Bopomofo 該不會就是 ㄅ ㄆ ㄇ ㄈ 吧…
沒錯,我很興奮地呼叫出來結果是….

很好…還是繼續等微軟吧…XD…不過有看到這代表有一天是會有中文輸入的…
下面附上我在intelligent sense 看到的鍵盤設定們…






讚一下:
標籤:
Silverlight,
Windows Phone 7
|
This entry was posted on 凌晨3:15
and is filed under
Silverlight
,
Windows Phone 7
.
You can follow any responses to this entry through
the RSS 2.0 feed.
You can leave a response,
or trackback from your own site.
訂閱:
張貼留言 (Atom)
0 意見:
張貼留言