カレンダーの一部として、1日ビューとイベントビューの2つのビューがあります。幅のある日のビューを埋めるイベントが必要ですが、同じ位置/時間に別のイベントを追加すると、それらのイベントの幅を分割したいと思っています...私は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