2012-03-04 21 views
0

以下是登錄按鈕的代碼:的PhoneGap - 登錄按鈕UI改性

<button type="submit" data-theme="a" id="loginButton">Login</button> 

現在,我必須增加登錄按鈕大小和顯示在頁面的中心。請分享,如果有任何想法。

回答

1

如果使用ecplise,那麼你可以使用Layout weight下按鈕 的地產板塊還是一個更快的方法是設置

<button 
    type="submit" 
    data-theme="a" 
    android:layout_width="40dp" //set size depending on your requirements 
    android:layout_width="wrap_content" 
    android:layout_centerInParent="true" 
    id="loginButton"> 

     Login 

    </button> 

編輯:對不起,我想你需要增加按鈕的大小。對於圍繞它,使用 RelativeLayout

<RelativeLayout android:id="@+id/RelativeLayout01" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     xmlns:android="http://schemas.android.com/apk/res/android"> 

     <button 
     type="submit" 
     data-theme="a" 
     android:layout_width="40dp" //set size depending on your requirements 
     android:layout_width="wrap_content" 
     android:layout_centerInParent="true" 
     id="loginButton"> 

     Login 

    </button> 

</RelativeLayout> 

屬性android:layout_centerInParent="true"將相對於居中屏幕

+1

如何使頁面的按鈕中心? – 2012-03-04 07:31:22

+1

我使用phonegap和HTML來顯示按鈕。請幫助我集中phonegap按鈕 – 2012-03-04 07:53:04