Ich habe zwei Ansichten, eine Tagesansicht und eine Ereignisansicht als Teil eines Kalenders. Ich möchte, dass meine Ereignisse die Tagesansicht in der Breite füllen (was funktioniert), aber wenn ich ein anderes zur selben Position/Zeit hinzufüge, möchte ich, dass sie die Breite teilen ... Ich füge mein Ereignis dynamisch mit Java hinzu. Gibt es ein Attribut, das ich verwenden kann, damit sich die Ansichten nicht überschneiden?Ansichten anhalten, die sich in einem relativen Layout horizontal überlappen
<?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>
So würde ich zum Zeitpunkt der Einfügung des ersten Ereignisses wissen müssen, dass ein Ereignis in der gleichen Position hinzugefügt wird ?? und dann Platz dafür machen? – ovg