scrollview在我的布局

时间:2016-01-08 10:17:12

标签: android

我创建了一个名为DashboardLayout的布局,它包含在另一个RelativeLayout中。

我的DashboardLayout在下面给出

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ScrollView01"
android:layout_width="fill_parent"
android:fillViewport="true"
android:layout_height="fill_parent">
<com.psybo.shahi.localareaportal.DashboardLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#f8f9fe">
<!--  News Feed Button -->
<Button
    android:id="@+id/btn_news_feed"
    style="@style/DashboardButton"
    android:drawableTop="@drawable/place"
    android:text="@string/my_place" />

<!--  Friends Button -->
<Button
    android:id="@+id/btn_friends"
    style="@style/DashboardButton"
    android:drawableTop="@drawable/education"
    android:text="@string/education" />

<!--  Messages Button -->
<Button
    android:id="@+id/btn_messages"
    style="@style/DashboardButton"
    android:drawableTop="@drawable/bus"
    android:text="@string/bus_time" />

<!--  Places Button -->
<Button
    android:id="@+id/btn_places"
    style="@style/DashboardButton"
    android:drawableTop="@drawable/train"
    android:text="@string/train_time" />

<!--  Events Button -->
<Button
    android:id="@+id/btn_events"
    style="@style/DashboardButton"
    android:drawableTop="@drawable/auto"
    android:text="@string/auto" />

  

然后,上面的布局包含在RelativeLayout

 <?xml version="1.0" encoding="utf-8"?>

<RelativeLayout android:id="@+id/home"        xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
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"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.psybo.shahi.localareaportal.MainActivity">
    <include layout="@layout/fragment_layout" />
</RelativeLayout>

我的布局如下:

enter image description here

在DashboardLayout中运行滚动视图后不起作用。将DashboardLayout的高度更改为wrap_content.I得到了此布局

enter image description here

1 个答案:

答案 0 :(得分:1)

从相对布局中删除这些代码

echo "<tr  class=\"gradeA\">
      <td>$i</td>
      <td>$id</td>
      <td>$gccode</td>
      <td>$datecreated</td>
      <td>$notes</td>
      <td>$branch</td>
      <td>" . ($value['groupid']=="1") ? 'Regular' : 'Complimentary'. "</td><td>$status</td>
      </tr>";