0
저는이 TableRow를 오른쪽으로 채우려고 노력하고 있지만 행운이 없습니다. 나는 안드로이드 : 너비의 모든 조합을 시도했다고 생각합니다. 그래서 저는 전문가에게 줄 것입니다. 아래의 스크린 샷과 xml : 팁 : 해당 "TableRow"로 이동하려면 "////"의 CTRL + F를 누르십시오. 당신의 TableRow가있는 ScrollView 내부이기 때문에TableRow가 오른쪽으로 채워지지 않습니다.
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/TableLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.hogarth45.smartestdiner.MainActivity$PlaceholderFragment"
android:background="@drawable/sdback" >
<!--
<TableRow
android:id="@+id/tableRow0"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal">
<TextView
android:id="@+id/textView1"
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="@string/SD"
android:textColor="#CC4D22"
android:textSize="30sp"
android:textStyle="bold"
/>
</TableRow>
-->
<TableRow
android:id="@+id/tableRow1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<EditText
android:id="@+id/ZIPeditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="5"
android:hint="@string/ZIP_txtview"
android:inputType="number" >
<requestFocus />
</EditText>
<Spinner
android:id="@+id/Day_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:entries="@array/days_array" />
<Spinner
android:id="@+id/Choice_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:entries="@array/choice_array" />
<Spinner
android:id="@+id/Price_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:entries="@array/price_array" />
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<Button
android:id="@+id/Submit_butt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/Submit_butt_txt" />
</TableRow>
<TableRow
android:id="@+id/tableRow3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_span="4"
>
<!-- android:padding="5dp"-->
<TableLayout
android:id="@+id/scrollytable"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:stretchColumns="yes"
>
<!-- android:padding="5dp"-->
<!-- ///////////////Here is the row that is being clipped//////android:stretchColumns="1,2,1,1"///////////////////////////////////////////// -->
<TableRow
android:id="@+id/StockTableScrollView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:stretchColumns ="*"
android:background="@android:color/transparent"
>
<TextView
android:id="@+id/Dinner_name_textView"
android:layout_height="wrap_content"
android:text="@string/eman"
android:layout_column="0"
android:textIsSelectable="true"
android:layout_width="0dip"
android:paddingRight="3dp"
android:layout_weight="1" />
<TextView
android:id="@+id/Special_txtview"
android:layout_height="wrap_content"
android:text="@string/ceps"
android:layout_column="1"
android:textIsSelectable="true"
android:layout_width="0dip"
android:layout_weight="3"/>
<Button
android:id="@+id/moreInfoButt"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:text="@string/Butt_txt_Info" />
<Button
android:id="@+id/WebButton"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="3"
android:text="@string/Butt_txt_Map" />
</TableRow>
<!-- ////////////////////////////////////////////////////////////////// -->
</TableLayout>
</ScrollView>
</TableRow>
<TableRow
android:id="@+id/tableRow4"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<Button
android:id="@+id/ClearButt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/Clear_butt_txt" />
</TableRow>
</TableLayout>
는
이
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
>
ScrollView를 부모와 일치 시키려고했습니다. 그러나 운이 없다. ScrollView가 여유 공간을 차지한다는 이상한 것처럼 보입니다. – hogarth45
ScrollView를 제거해야합니다 –
ScrollView – hogarth45