Страница 1 из 1
Помогите с разметкой TableLayout
Добавлено: 20 сен 2014, 13:20
oleg_en
Добрый день всем гуру и начинающим как я. Столкнулся с такой проблемой, третий день не могу найти решение.
Помогите. Как в TableLayout объеденить два столбца. Пробовал layout_span но он объеденяет строки а не столбцы.
Конечный результат нужиен типа этого:
--------------------------------------------
|Наименование| Ед.Изм |Цена|Сумма|
| | шт |уп | | |
--------------------------------------------
Чтобы единицы измерения занимали в верхней строчки на два столбца.
Заранее благодарен всем, кто откликнится.
Re: Помогите с разметкой TableLayout
Добавлено: 20 сен 2014, 13:23
Foenix
не морочтесь с этим лэйаутом, используйте кастомизированный список. Таблички оставьте для десктопа. Данный лэйаут не для тех целей, что вы описали. Посмотрите приложения под андроид - почти любое со списком (тот же gmail). Делать нужно аналогично.
Re: Помогите с разметкой TableLayout
Добавлено: 20 сен 2014, 13:25
Foenix
Для товарных дел есть приложения на маркете - посмотрите как там сделано, тот же Наполеон.
Re: Помогите с разметкой TableLayout
Добавлено: 20 сен 2014, 13:31
oleg_en
Работаю в торговой компании, пытаюсь написать что то подобное "наполеону" для своих торговых агентов.
И вот никак не получается нарисовать Activity для заполнения количества товара и выбора цены.
Вся проблема в разметке, думал в андроиде проще нарисовать таблицу, аналогично бух.программам.
И еще странно, почему в инете в описаниях layout_span объеденяет столбцы, а у меня он объеденяет строки.
Re: Помогите с разметкой TableLayout
Добавлено: 20 сен 2014, 13:34
altwin
oleg_en писал(а):Работаю в торговой компании, пытаюсь написать что то подобное "наполеону" для своих торговых агентов.
И вот никак не получается нарисовать Activity для заполнения количества товара и выбора цены.
Вся проблема в разметке, думал в андроиде проще нарисовать таблицу, аналогично бух.программам.
И еще странно, почему в инете в описаниях layout_span объеденяет столбцы, а у меня он объеденяет строки.
попробуйте что -то такое:
[syntax=xml]
<TableLayout xmlns:android="
http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TableRow>
<TextView android:id="@+id/info"
android:layout_span="2"
android:text="some text"
android:padding="3dip"
android:layout_gravity="center_horizontal" />
</TableRow>
<TableRow>
<TextView android:text="some other text"
android:padding="3dip" />
<TextView android:text="more text"
android:padding="3dip" />
</TableRow>
</TableLayout>
[/syntax]
Re: Помогите с разметкой TableLayout
Добавлено: 20 сен 2014, 13:40
oleg_en
Работает.
Ну я непойму почему у меня нехочет.
Код: Выделить всё
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/lvMain"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TableLayout
android:id="@+id/tLyaout2"
android:background="#000000"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:shrinkColumns="*"
android:stretchColumns="*"
android:layout_gravity="top"
>
<TableRow android:background="#FFF"
android:layout_marginBottom="1dp">
<TextView
android:id="@+id/tvc01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:id="@+id/tvc02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:id="@+id/tvc03"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:id="@+id/tvc04"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:id="@+id/tvc05"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:id="@+id/tvc06"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:id="@+id/tvc07"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:id="@+id/tvc08"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
</TableRow>
<TableRow
android:id="@+id/tR1"
android:background="#000000"
>
<TextView
android:id="@+id/tvc1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="1dp"
android:padding="5dp"
android:background="#FFF"
android:text="@string/caption_code" />
<TextView
android:id="@+id/tvc2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="1dp"
android:padding="5dp"
android:background="#FFF"
android:text="@string/caption_entity" />
<TextView
android:id="@+id/tvc3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="1dp"
android:paddingLeft="1dp"
android:paddingTop="5dp"
android:layout_span="2"
android:background="#FFF"
android:text="@string/caption_unit" />
<TextView
android:id="@+id/tvc4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/caption_qty"
android:padding="5dp"/>
<TextView
android:id="@+id/tvc5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/caption_price" />
<TextView
android:id="@+id/tvc6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/caption_sum" />
</TableRow>
<TableRow
android:id="@+id/tR2"
android:background="#000000"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="1dp"
android:layout_marginRight="1dp"
android:layout_marginBottom="1dp"
>
<TextView
android:id="@+id/tvc7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="1dp"
android:background="#FFF" />
<TextView
android:id="@+id/tvc8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="1dp"
android:background="#FFF" />
<TextView
android:id="@+id/tvc9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Unit" />
<TextView
android:id="@+id/tvc10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Unit2" />
</TableRow>
</TableLayout>
<TextView
android:id="@+id/tvResult"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal" >
<TextView
android:id="@+id/tvPrice"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/Price" />
<Spinner
android:id="@+id/spinnerPrice"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
<TableLayout
android:id="@+id/tLyaout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom" >
<TableRow
android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<Button
android:id="@+id/btn1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/one" />
<Button
android:id="@+id/btn2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/two" />
<Button
android:id="@+id/btn3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/three" />
<Button
android:id="@+id/btn4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/four" />
<Button
android:id="@+id/btn5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/five" />
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<Button
android:id="@+id/btn6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/six" />
<Button
android:id="@+id/btn7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/seven" />
<Button
android:id="@+id/btn8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/eith" />
<Button
android:id="@+id/btn9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/nain" />
<Button
android:id="@+id/btn0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/zero" />
</TableRow>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent" >
<ToggleButton
android:id="@+id/toggleButton1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.3"
android:text=""
android:textOff="@string/Unit"
android:textOn="@string/Unit" />
<ToggleButton
android:id="@+id/toggleButton2"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.3"
android:text=""
android:textOff="@string/Unit2"
android:textOn="@string/Unit2" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="3" />
<Button
android:id="@+id/btnZnak"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="@string/Znak" />
<Button
android:id="@+id/btnDel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/Del" />
<Button
android:id="@+id/btnOk"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/Ok" />
</LinearLayout>
</TableLayout>
</FrameLayout>
Re: Помогите с разметкой TableLayout
Добавлено: 20 сен 2014, 13:44
altwin
oleg_en писал(а):Работает.
Ну я непойму почему у меня нехочет.
Код: Выделить всё
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/lvMain"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TableLayout
android:id="@+id/tLyaout2"
android:background="#000000"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:shrinkColumns="*"
android:stretchColumns="*"
android:layout_gravity="top"
>
<TableRow android:background="#FFF"
android:layout_marginBottom="1dp">
<TextView
android:id="@+id/tvc01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:id="@+id/tvc02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:id="@+id/tvc03"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:id="@+id/tvc04"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:id="@+id/tvc05"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:id="@+id/tvc06"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:id="@+id/tvc07"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:id="@+id/tvc08"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
</TableRow>
<TableRow
android:id="@+id/tR1"
android:background="#000000"
>
<TextView
android:id="@+id/tvc1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="1dp"
android:padding="5dp"
android:background="#FFF"
android:text="@string/caption_code" />
<TextView
android:id="@+id/tvc2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="1dp"
android:padding="5dp"
android:background="#FFF"
android:text="@string/caption_entity" />
<TextView
android:id="@+id/tvc3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="1dp"
android:paddingLeft="1dp"
android:paddingTop="5dp"
android:layout_span="2"
android:background="#FFF"
android:text="@string/caption_unit" />
<TextView
android:id="@+id/tvc4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/caption_qty"
android:padding="5dp"/>
<TextView
android:id="@+id/tvc5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/caption_price" />
<TextView
android:id="@+id/tvc6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/caption_sum" />
</TableRow>
<TableRow
android:id="@+id/tR2"
android:background="#000000"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="1dp"
android:layout_marginRight="1dp"
android:layout_marginBottom="1dp"
>
<TextView
android:id="@+id/tvc7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="1dp"
android:background="#FFF" />
<TextView
android:id="@+id/tvc8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="1dp"
android:background="#FFF" />
<TextView
android:id="@+id/tvc9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Unit" />
<TextView
android:id="@+id/tvc10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Unit2" />
</TableRow>
</TableLayout>
<TextView
android:id="@+id/tvResult"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal" >
<TextView
android:id="@+id/tvPrice"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/Price" />
<Spinner
android:id="@+id/spinnerPrice"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
<TableLayout
android:id="@+id/tLyaout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom" >
<TableRow
android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<Button
android:id="@+id/btn1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/one" />
<Button
android:id="@+id/btn2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/two" />
<Button
android:id="@+id/btn3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/three" />
<Button
android:id="@+id/btn4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/four" />
<Button
android:id="@+id/btn5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/five" />
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<Button
android:id="@+id/btn6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/six" />
<Button
android:id="@+id/btn7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/seven" />
<Button
android:id="@+id/btn8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/eith" />
<Button
android:id="@+id/btn9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/nain" />
<Button
android:id="@+id/btn0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/zero" />
</TableRow>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent" >
<ToggleButton
android:id="@+id/toggleButton1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.3"
android:text=""
android:textOff="@string/Unit"
android:textOn="@string/Unit" />
<ToggleButton
android:id="@+id/toggleButton2"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.3"
android:text=""
android:textOff="@string/Unit2"
android:textOn="@string/Unit2" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="3" />
<Button
android:id="@+id/btnZnak"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="@string/Znak" />
<Button
android:id="@+id/btnDel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/Del" />
<Button
android:id="@+id/btnOk"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/Ok" />
</LinearLayout>
</TableLayout>
</FrameLayout>
попробуйте в TableRow в котором устанавливаете
android:layout_span="2" добавить еще один TextView. В первом у вас 8 секций во втором получается 7 возможно проблема в этом.
Re: Помогите с разметкой TableLayout
Добавлено: 20 сен 2014, 13:55
Foenix
Вот и берите пример с Наполеона- там нет табличек. Самое классное в этой программе (хотя она и достаточно устарела) - это заточенность под быстроту. Я работаю с торговыми представителями, и для них самое важное именно это - чтоб на точке не тупить а быстро оформить заказ, потому что там никто ждать не станет.
Так вот таблички эти, которые вы пытаетесь сделать - это все загромождает интерфейс и кроме того - не юзабельно.
Активити делается просто.
Создаете ее, кидаете на нее листьвью
Листвью делаете кастомный, с кастомным же лэйаутом каждой строки. Распологаете на этих строках информацию.
Данный листвью служит для одной цели - кликом на нем положить товар в заказ. Клик на нем выдает диалог в котором на клавиатуре набирается количество. ВСЕ.
Хотя если вы знакомы с Наполеоном, то все это и так знать как бы должны.
Re: Помогите с разметкой TableLayout
Добавлено: 20 сен 2014, 14:00
Foenix
Кстати, в данном листвью не нужны колонки, которые вы пытаетесь туда запихнуть
|Наименование| Ед.Изм |Цена|Сумма|| | шт |уп | | |
Если это лисвью товара, который УЖЕ в заказе то
Наименование, количество, сумма.
Если это листвью с номенклатурой, для выборки товара в заказ - то
Наименование, Цена за единицу, количество на складе.
(все это в листвью прекрасно помещается - слева наименование, справа - цена и под ней количество)
Вся дополнительная информация - единицы измерения, упаковки и прочее - это все в тех диалогах, о которых я говорила выше. Не загромождайте экран, ТП и так знаю в каких у них единицах измерения товары, им не нужно на них постоянно смотреть.
Re: Помогите с разметкой TableLayout
Добавлено: 20 сен 2014, 14:04
oleg_en
altwin писал(а):oleg_en писал(а):Работает.
Ну я непойму почему у меня нехочет.
Код: Выделить всё
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/lvMain"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TableLayout
android:id="@+id/tLyaout2"
android:background="#000000"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:shrinkColumns="*"
android:stretchColumns="*"
android:layout_gravity="top"
>
<TableRow android:background="#FFF"
android:layout_marginBottom="1dp">
<TextView
android:id="@+id/tvc01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:id="@+id/tvc02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:id="@+id/tvc03"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:id="@+id/tvc04"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:id="@+id/tvc05"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:id="@+id/tvc06"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:id="@+id/tvc07"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:id="@+id/tvc08"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
</TableRow>
<TableRow
android:id="@+id/tR1"
android:background="#000000"
>
<TextView
android:id="@+id/tvc1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="1dp"
android:padding="5dp"
android:background="#FFF"
android:text="@string/caption_code" />
<TextView
android:id="@+id/tvc2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="1dp"
android:padding="5dp"
android:background="#FFF"
android:text="@string/caption_entity" />
<TextView
android:id="@+id/tvc3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="1dp"
android:paddingLeft="1dp"
android:paddingTop="5dp"
android:layout_span="2"
android:background="#FFF"
android:text="@string/caption_unit" />
<TextView
android:id="@+id/tvc4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/caption_qty"
android:padding="5dp"/>
<TextView
android:id="@+id/tvc5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/caption_price" />
<TextView
android:id="@+id/tvc6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/caption_sum" />
</TableRow>
<TableRow
android:id="@+id/tR2"
android:background="#000000"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="1dp"
android:layout_marginRight="1dp"
android:layout_marginBottom="1dp"
>
<TextView
android:id="@+id/tvc7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="1dp"
android:background="#FFF" />
<TextView
android:id="@+id/tvc8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="1dp"
android:background="#FFF" />
<TextView
android:id="@+id/tvc9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Unit" />
<TextView
android:id="@+id/tvc10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Unit2" />
</TableRow>
</TableLayout>
<TextView
android:id="@+id/tvResult"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal" >
<TextView
android:id="@+id/tvPrice"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/Price" />
<Spinner
android:id="@+id/spinnerPrice"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
<TableLayout
android:id="@+id/tLyaout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom" >
<TableRow
android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<Button
android:id="@+id/btn1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/one" />
<Button
android:id="@+id/btn2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/two" />
<Button
android:id="@+id/btn3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/three" />
<Button
android:id="@+id/btn4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/four" />
<Button
android:id="@+id/btn5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/five" />
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<Button
android:id="@+id/btn6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/six" />
<Button
android:id="@+id/btn7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/seven" />
<Button
android:id="@+id/btn8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/eith" />
<Button
android:id="@+id/btn9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/nain" />
<Button
android:id="@+id/btn0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/zero" />
</TableRow>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent" >
<ToggleButton
android:id="@+id/toggleButton1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.3"
android:text=""
android:textOff="@string/Unit"
android:textOn="@string/Unit" />
<ToggleButton
android:id="@+id/toggleButton2"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.3"
android:text=""
android:textOff="@string/Unit2"
android:textOn="@string/Unit2" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="3" />
<Button
android:id="@+id/btnZnak"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="@string/Znak" />
<Button
android:id="@+id/btnDel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/Del" />
<Button
android:id="@+id/btnOk"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/Ok" />
</LinearLayout>
</TableLayout>
</FrameLayout>
попробуйте в TableRow в котором устанавливаете
android:layout_span="2" добавить еще один TextView. В первом у вас 8 секций во втором получается 7 возможно проблема в этом.
Спасибо!!!! Получилось !!!
Re: Помогите с разметкой TableLayout
Добавлено: 20 сен 2014, 14:10
altwin
Foenix писал(а):Кстати, в данном листвью не нужны колонки, которые вы пытаетесь туда запихнуть
|Наименование| Ед.Изм |Цена|Сумма|| | шт |уп | | |
Если это лисвью товара, который УЖЕ в заказе то
Наименование, количество, сумма.
Если это листвью с номенклатурой, для выборки товара в заказ - то
Наименование, Цена за единицу, количество на складе.
(все это в листвью прекрасно помещается - слева наименование, справа - цена и под ней количество)
Вся дополнительная информация - единицы измерения, упаковки и прочее - это все в тех диалогах, о которых я говорила выше. Не загромождайте экран, ТП и так знаю в каких у них единицах измерения товары, им не нужно на них постоянно смотреть.
А если это просто отчет?

И где ты там ListView нашла ?

Re: Помогите с разметкой TableLayout
Добавлено: 20 сен 2014, 14:22
Foenix
отчеты так не делаются
Re: Помогите с разметкой TableLayout
Добавлено: 20 сен 2014, 14:29
altwin
Foenix писал(а):отчеты так не делаются
Почему? 1C -экспортирует в excel из которого данные нужно как то показать на девайсе, чем тебе простая табличка для отображения текста не нравится? Помоему таблица именно для отображения таблиц.

При правильной конфигурации 1C умеет передавать csv по сети и удачно синхронизироваться, эту возможность тут тоже можно использовать.
Re: Помогите с разметкой TableLayout
Добавлено: 20 сен 2014, 14:51
Foenix
ты сейчас мух и котлет смешал вместе. Причем тут эксель? 1С? для этого есть эксель на девайсе! И если нужен эксель - я выгружаю эксель, но они его не смотрят на устройстве - это им не надо. Они эти эксели отправляют тому, кто будет его читать на десктопе.
Речь идет о быстром заполнении заказа.
Отчет же - он предназначен не для расчетов (т.к. ТП этим не занимаются), а для печати или просто посмотреть, отправить на почту.
Я много программ аналогичных просмотрела. Есть и с табличками. Интерфейс перегружен, не понятен, много места теряется зря.
Re: Помогите с разметкой TableLayout
Добавлено: 20 сен 2014, 15:15
altwin
Foenix писал(а):ты сейчас мух и котлет смешал вместе. Причем тут эксель? 1С? для этого есть эксель на девайсе! И если нужен эксель - я выгружаю эксель, но они его не смотрят на устройстве - это им не надо. Они эти эксели отправляют тому, кто будет его читать на десктопе.
Речь идет о быстром заполнении заказа.
Отчет же - он предназначен не для расчетов (т.к. ТП этим не занимаются), а для печати или просто посмотреть, отправить на почту.
Я много программ аналогичных просмотрела. Есть и с табличками. Интерфейс перегружен, не понятен, много места теряется зря.
https://play.google.com/store/apps/deta ... .crm&hl=ru ты имеешь в виду что -то такое? Я просто не знаю, что такое Наполеон... торт вроде ниче так был.
Дело не в том, что они не смотрят эти файлы. Дело в том, что твоя задача научить их этим пользоваться правильно. Не смотрят лишь потому, что это не удобно и грустно. Но почему они не могут перед посещением открыть информацию по конкретному клиенту из отчета на девайсе, который ты выведешь просто распарсив документ, и покажешь без лишнего и пустого места?
Да и не в этом дело. В свое время у меня около двух десятков супервайзеров было в подчинении и я тебе точно могу сказать, что для ТП - нет лишнего отчета, более того компании бывают разные и есть планирование, многи занимаются формированием заказов на следующий период и да, отчет им не нужен из 1c, но вот проанализированный результат для ознакомления в пути и быстрого ответа более чем необходим.
Суть сводится к тому, что полезно все и таблички бывают разные. Это может быть просто чек и кейса каждого заказчика знать не возможно.
Re: Помогите с разметкой TableLayout
Добавлено: 20 сен 2014, 15:30
Foenix
ты отклонился от темы, все это я хорошо знаю и так.
Ты мне покажи в твоей ссылке - табличку, но не просто отчет, а то, о чем спрашивал товарищ в первом сообщении.
А че у тебя торт "был"? он есть!

Киевские небось жрете там ))
Re: Помогите с разметкой TableLayout
Добавлено: 20 сен 2014, 16:27
altwin
Foenix писал(а):ты отклонился от темы, все это я хорошо знаю и так.
Ты мне покажи в твоей ссылке - табличку, но не просто отчет, а то, о чем спрашивал товарищ в первом сообщении.
А че у тебя торт "был"? он есть!

Киевские небось жрете там ))
То о чем спрашивал товарисч -
Помогите с разметкой TableLayout
А по поводу Киевского - у нас тут фильруют товары и все что связанно даже косвенно с Украиной -подлежит немедленной утилизации. Даже танки с Украинским флагом исчезают бесследно, а ты торт говоришь

Re: Помогите с разметкой TableLayout
Добавлено: 20 сен 2014, 19:57
Foenix
у.....убил еще раз! Киевский - вкуснющий! Настоящий Торт с большой буквы.
(но, наверное, больше никогда не попробую)
Re: Помогите с разметкой TableLayout
Добавлено: 20 сен 2014, 20:52
altwin
Foenix писал(а):у.....убил еще раз! Киевский - вкуснющий! Настоящий Торт с большой буквы.
(но, наверное, больше никогда не попробую)
Я практически не ем сладкое... как это не банально, но предпочитаю сырое мясо

Re: Помогите с разметкой TableLayout
Добавлено: 20 сен 2014, 20:54
Foenix
это не банально
