Проблема Android Layout - PullRequest
       1

Проблема Android Layout

0 голосов
/ 02 июня 2011

Привет, я пытался спроектировать свой макет так, как показано на рисунке ниже, но я не знаю как Так, ребята, не могли бы вы помочь мне переделать его или внести некоторые исправления

с нетерпением ждем от вас, ребята, спасибо за продвижение

<LinearLayout android:layout_width="fill_parent" android:layout_height="320dip">
<ImageView 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:text="@string/pic"
    android:id="@+id/picture">
</ImageView>
</LinearLayout>

<TableLayout android:layout_width="fill_parent"
    android:layout_height="fill_parent" android:gravity="center"
    android:stretchColumns="*">
    <TableRow android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:orientation="horizontal">
            <SeekBar android:id="@+id/seekbar" 
            android:layout_width="wrap_content" 
            android:layout_weight="1" 
            android:progress="3" 
            android:max="25"
            android:maxWidth="100px" 
            android:paddingRight="25px">
            </SeekBar>

            <TextView android:layout_width="fill_parent"
            android:layout_height="wrap_content" android:layout_weight="4"
            android:gravity="center"
            android:id="@+id/tx_color"
            android:text="None">
            </TextView>     

 </TableRow>
    <TableRow android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:orientation="horizontal">

        <RadioGroup android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:id="@+id/QueGroup1">
            <RadioButton android:checked="true"
            android:id="@+id/simple_mode" android:text="Default"/>
            <RadioButton android:checked="false"
            android:id="@+id/warn_mode" android:text="Warning"/>
            <RadioButton android:checked="false"
            android:id="@+id/grey_mode" android:text="Grey Scale"/>

            </RadioGroup>
    </TableRow>
</TableLayout>

| | | ImageView | | |
| | _ __ _ __ _ __ _ __ _ __ _ __ _ ___ | Spinner | TextView | | __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ | 3 из радио кнопок | _ __ _ __ _ __ _ __ _ __ _ __ _ __ извините за это б / к я не могу опубликовать изображение T ^ T

1 Ответ

3 голосов
/ 02 июня 2011

Это действительно зависит от того, как вы хотите, чтобы он выглядел (графика ascii там не сильно помогла :))

С одной стороны, ваш макет должен иметь один верхний контейнер ... так что вы можете сделать что-то вроде этого (мета-макет):

<LinearLayout android:orientation="vertical">
  <ImageView />
  <TableLayout>
    <TableRow>
      <SeekBar /> <!-- row 1 col 1 -->
      <TextView /> <!-- row 1 col 2 -->
    </TableRow>
    <TableRow>
      <TextView /> <!-- row 2 col 1, if you need an empty column, just leave the text empty -->
      <RadioGroup /> <!-- row 2 col 2 -->
    </TableRow>
  </TableLayout>
</LinearLayout>

Это то, что тебе нужно?

Будет сгенерировано что-то вроде этого:
Android Layout

UPD: Вы сказали, что хотите, чтобы радиогруппа была одним широким столбцом. В этом случае вы просто помещаете ее вне таблицы, так же как ImageView
Если этот пример представляет собой весь макет (т. Е. У вас нет других строк с seekBar / textViews, то вы можете полностью удалить TableLayout:

<LinearLayout android:orientation="vertical">
  <ImageView />
  <LinearLayout android:orientation="horizontal">
    <SeekBar />
    <TextView />
  </LinearLayout>
  <RadioGroup />
</LinearLayout>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...