0
我有兩個視圖,一個日視圖和一個事件視圖作爲日曆的一部分。我希望我的事件在寬度上填充日視圖(正在工作),但是當我在相同位置/時間添加另一個時,我希望它們分割寬度...我使用java動態添加事件。是否有我可以使用的屬性,以便視圖不重疊?停止視圖在相對佈局中水平重疊
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:id="@+id/dayView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/day_view">
</RelativeLayout>
。
<?xml version="1.0" encoding="utf-8"?>
<ie.test.calendar.CalendarEventView
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:id="@+id/eventView"
android:background="@drawable/event_view"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/eventTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="3dp"
android:paddingBottom="5dp"
android:paddingLeft="5dp"
android:paddingRight="3dp"
android:textAppearance="@android:style/TextAppearance.Medium"
android:textColor="@android:color/white"/>
</ie.test.calendar.CalendarEventView>
所以我必須知道在插入第一個事件時有一個事件將被添加到相同的位置?然後爲它騰出空間? – ovg