2014-09-25 2 views
-1

Я добавляю таблички динамически в таблице layout.When я использую как вертикальную, так и горизонтальную полосу прокрутки. В горизонтальном прокрутке я получаю некоторое пространство в своем макете. Мой файл XMLУдалить пространство для горизонтальной полосы прокрутки

это-
<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" > 

    <ScrollView 
     android:id="@+id/scrollView1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:scrollbars="none"> 

     <HorizontalScrollView 
     android:id="@+id/horizontalScrollView1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:scrollbars="none"> 

<TableLayout 
     android:stretchColumns="*" 
     android:id="@+id/main_table" 
     android:layout_weight="1" 
     android:layout_height="wrap_content" 
     android:layout_width="match_parent"> 


</TableLayout> 
     </HorizontalScrollView> 
    </ScrollView> 







</LinearLayout> 

Скриншот IS-

enter image description here

Я хочу удалить это пространство с правой стороны.

+0

вы пробовали 'андроида: layout_weight = "wrap_content"' для 'TableLayout' –

+0

Анушкой, я думаю, вы должны установить layout_width =» match_parent " –

+0

plz опубликовать ваш макет строки xml-файл –

ответ

2

Простое изменение

<ScrollView 
    android:id="@+id/scrollView1" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:scrollbars="none"> 

    <HorizontalScrollView 
    android:id="@+id/horizontalScrollView1" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:scrollbars="none"> 

к этому

<ScrollView 
    android:id="@+id/scrollView1" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:scrollbars="none"> 

    <HorizontalScrollView 
    android:id="@+id/horizontalScrollView1" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:scrollbars="none"> 
+0

(Так что измените wrap_content на match_parent для ширины) –

+0

@ Kostya Khuta- Его не работает. Понимая это пространство в правой части. –

+0

это весь ваш xml-файл? –

Смежные вопросы