Мне нужен ящик внутри ящика с ~ 33% пустого пространства вверху первого ящика, а затем еще один ящик под ним.Мне нужно, чтобы это было в центре.Я хотел бы, чтобы это было по существу fill_parent
на мобильном телефоне, но на планшете (основное устройство для этого приложения) он должен оставаться того же размера, но быть в центре экрана.Как я могу это сделать?
Я привожу примеры, так как мне немного сложно объяснить. Планшет
|---------------------------------------|
| ~33% Blank space |
| |
| |---------------------| |
| | | |
| | | |
| | Login Box | |
| | Password | |
| | | |
| | | |
| | | |
| | | |
| | | |
| |---------------------| |
|---------------------------------------|
Редактировать Вот XML, который у меня сейчас есть.Я не получаю intellisense для чего-либо, (я обычно получаю предложения), и я получаю исключение приведения с несколькими макетами.Что-то не так с XML?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:weightSum="1"
>
<LinearLayout android:id="@+id/topSpacer"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight=".33"
android:orientation="horizontal"
></LinearLayout>
<LinearLayout
android:id="@+id/bottomSection"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight=".67"
android:orientation="horizontal"
>
<LinearLayout
android:id="@+id/loginSection"
android:layout_width="320dip"
android:layout_height="fill_parent"
android:background="#FFFFFF"
>
<TextView
android:text=""
android:id="@+id/errorMessage"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
/>
<TextView
android:text="Please login using your active directory credentials."
android:id="@+id/loginMessage"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
/>
<AutoCompleteTextView
android:id="@+id/loginUsername"
android:text="Username"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<EditText
android:id="@+id/loginPassword"
android:text="Password"
android:password="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<Button
android:id="@+id/loginButton"
android:text="Login"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:text="results"
android:id="@+id/resultsMessage"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>