2017-06-22 13 views
0

私はマテリアルカレンダービューを配置していますが、カレンダーの高さを画面の半分にして、レイアウトの重みを使ってカレンダーを全幅で占めないようにします。 もう一つの問題は、私は、日付の文字サイズを大きくしたいということである私に任意のアイデアを参照してくださいMaterialCalendarViewは全幅を占めていません

XML:

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 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:orientation="vertical" 
    tools:context="symphony.acube.com.symphony.activity.patient.acitivity.mySchedule.MyScheduleActivity"> 
    <include layout="@layout/toolbar_layout"></include> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="vertical"> 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:id="@+id/llCalendarContainer" 
      android:orientation="vertical" 
      android:layout_weight="1"> 

      <com.prolificinteractive.materialcalendarview.MaterialCalendarView 
       xmlns:app="http://schemas.android.com/apk/res-auto" 
       android:id="@+id/calendarView" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       app:mcv_showOtherDates="all" 
       app:mcv_selectionColor="@color/toolbar_red" 
       /> 
     </LinearLayout> 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_weight="1"> 


     </LinearLayout> 
    </LinearLayout> 


</LinearLayout> 

次私は現在

enter image description here取得しています実際のウィンドウがあります

上記のカレンダーでは、全幅を占める必要があり、また日付のテキストサイズはいくらか大きい必要があります ありがとうございます

カレンダーの幅を延伸する

答えて

0

べき:

measureTileSize(方法onMeasureクラスMaterialCalendarViewにおける)の因子によって低減

int childHeightMeasureSpec = MeasureSpec.makeMeasureSpec ((int) (p.height * (measureTileSize/1.5)), MeasureSpec.EXACTLY); 

同様にMonthView

int childHeightMeasureSpec = MeasureSpec.makeMeasureSpec ((int) (measureTileSize/1.5), MeasureSpec.EXACTLY); 
で行われます

何かが背景に浮かんでいます(楕円形に伸びています)

これに続き、issue

+0

あなたの応答のための@ Zeeshan Shabbir。私は上記のコードを実装する場所がわかりません。私は初心者ですので、私を容認してください。 –

+0

私は答えで述べた問題を通過してください。それぞれとすべてがそこにあります。私はあなたが徹底的に問題を読んで、libarayのクラスを探検するなら、それがあなたを助けることを願っています –

関連する問題