2013-05-01 53 views
0

我在屏幕上定義了多個編輯字段。他們採取名字,姓氏,電子郵件和我們的郵政編碼。我怎樣才能改變這樣,當重點是如何在XMADL中設置正確的鍵盤類型?

  • 名字和姓氏的鍵盤 - 第一個字母大寫
  • 電子郵件 - 鍵盤顯示符號「@」和「.COM」
  • 我們的郵政編碼 - 鍵盤只顯示數字。

    <screens> 
        <screen name="userprofile" screen_type="SCREEN" allow_reorientation="true" allowed_layouts="BOTH" scroll="VERTICAL" 
          width="100" height="100" local_data_source="select lastname, firstname, email, zipcode from user_details where email=&apos;&lt;email&gt;&apos;" > 
         <title_controls> 
          <control type="TEXT" x="0" y="1" width="100" height="6" default_value="Profile" 
            appearance_name="white" data_type="VARCHAR"> 
          </control> 
         </title_controls> 
    
         <controls> 
          <control name="labelfirstname" type="TEXT" x="2" y="3" width="30" height="8" 
            appearance_name="black" data_type="VARCHAR" default_value="First Name"/> 
          <control name="editfirstname" type="EDIT" x="35" y="2" width="50" height="8" 
            appearance_name="edit_box" data_type="VARCHAR" field_name="firstname" 
            default_value="" size="80"/> 
          <control name="labellastname" type="TEXT" x="2" y="12" width="30" height="8" 
            appearance_name="black" data_type="VARCHAR" default_value="Last Name"/> 
          <control name="editlastname" type="EDIT" x="35" y="12" width="50" height="8" 
            appearance_name="edit_box" data_type="VARCHAR" field_name="lastname" 
            default_value="" size="80"/> 
          <control name="labelemail" type="TEXT" x="2" y="22" width="30" height="8" 
            appearance_name="black" data_type="VARCHAR" default_value="Email"/> 
          <control name="editemail" type="TEXT" x="35" y="22" width="50" height="8" 
            appearance_name="black" data_type="VARCHAR" field_name="email" 
            default_value="" size="80"/> 
          <control name="labelzip" type="TEXT" x="2" y="32" width="30" height="8" 
            appearance_name="black" data_type="VARCHAR" default_value="Zip Code"/> 
          <control name="editzipcode" type="EDIT" x="35" y="32" width="50" height="8" 
            appearance_name="edit_box" word_wrap="0" data_type="VARCHAR" field_name="zipcode" default_value="" size="80"/> 
         </controls> 
        </screen> 
    </screens> 
    

回答

0

您可以設置使用屬性「keyboard_type」每個編輯區域的鍵盤類型。

  • 對於控件「editfirstname」和「editlastname」,添加屬性keyboard_type =「CAP_WORDS」。這將使每項工作的首字母大寫。

    <control name="editfirstname" type="EDIT" x="35" y="2" width="50" height="8" appearance_name="edit_box" data_type="VARCHAR" field_name="firstname" default_value="" size="80" keyboard_type=」CAP_WORDS」/> 
    <control name="editlastname" type="EDIT" x="35" y="12" width="50" height="8" appearance_name="edit_box" data_type="VARCHAR" field_name="lastname" default_value="" size="80" keyboard_type=」CAP_WORDS」/ > 
    
  • 爲控件「editemail」添加屬性keyboard_type =「EMAIL_ADDRESS」。這將使符號「@」和「.COM」出現在鍵盤

    <control name="editemail" type="TEXT" x="35" y="22" width="50" height="8" appearance_name="black" data_type="VARCHAR" field_name="email" default_value="" size="80" keyboard_type=」EMAIL_ADDRESS」/> 
    
  • 對於控制「editzipcode」上添加屬性keyboard_type =」數字」。鍵盤將只顯示數字和字符「 - 」,「/」

    <control name="editzipcode" type="EDIT" x="35" y="32" width="50" height="8" appearance_name="edit_box" word_wrap="0" data_type="VARCHAR" field_name="zipcode" default_value="" size="80" keyboard_type=」NUMBER」/> 
    

你可以閱讀更多關於keyboard_type here