0

Here is my calendar view

<CalendarView
    android:id="@+id/calendarView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginLeft="10dp"
    android:layout_marginRight="10dp"
    android:layout_above="@+id/tableLayout"
    android:layout_alignParentTop="true" />

Below this I have 3 buttons with the below given xml

<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent" android:layout_height="wrap_content"
    android:id="@+id/tableLayout"
    android:padding="5dp" android:stretchColumns="0"
    android:textAlignment="center"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true">

    <TableRow
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:id="@+id/tableRow1">
        <Button
            android:id="@+id/trackAttendance"
            android:layout_height="wrap_content"
            android:text="Track Class Attendance"
            android:paddingLeft="30dp"
            android:paddingRight="30dp"
            android:layout_marginTop="5dp"
            android:layout_marginBottom="5dp"
            android:layout_width="50dp"
            android:textColor="#ffffff"
            android:textSize="15dp"
            android:background="@drawable/mybuttons"> </Button>
    </TableRow>
    <TableRow
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:id="@+id/tableRow2">
        <Button
            android:id="@+id/trackSessions"
            android:layout_height="wrap_content"
            android:text="Track Study Sessions"
            android:paddingLeft="30dp"
            android:paddingRight="30dp"
            android:layout_marginTop="5dp"
            android:layout_marginBottom="5dp"
            android:layout_width="50dp"
            android:textColor="#ffffff"
            android:textSize="15dp"
            android:background="@drawable/mybuttons"> </Button>
    </TableRow>
    <TableRow
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:id="@+id/tableRow3">
        <Button
            android:id="@+id/trackActivities"
            android:layout_height="wrap_content"
            android:text="Track Class Activities"
            android:paddingLeft="30dp"
            android:paddingRight="30dp"
            android:layout_marginTop="5dp"
            android:layout_marginBottom="5dp"
            android:layout_width="50dp"
            android:textColor="#ffffff"
            android:textSize="15dp"
            android:background="@drawable/mybuttons"> </Button>
        </TableRow>

</TableLayout>

I am unable to view all the days for month in the calendar view when i run it on some phones with screen size less than 4.5". It is displayed as shown below

enter image description here

Is there any work around for this without using stock google calendarview. Thanks in advance

human
  • 637
  • 4
  • 15
  • 41

1 Answers1

2

This is Happening Because heights of your Buttons are wrap_content..

So Buttons overlapping Your Calendar View

Either Try creating Layout Using ScrollView Refer This .

or

Use LinearLayout with weightsum and layout_Weight. Refer This .

Community
  • 1
  • 1
Deep Dave
  • 159
  • 1
  • 8