在RadCalendar中增加dayNameCells的高度

时间:2019-06-23 02:28:42

标签: nativescript angular2-nativescript nativescript-angular nativescript-telerik-ui

我正在尝试为我的本机脚本应用程序创建每周日历视图。问题出在android的样式中。工作日名称的顶部和底部没有足够的间距。

我尝试以编程方式增加高度,但是没有影响。

        const weekViewStyle = new CalendarWeekViewStyle();
        const dayNameCellStyle = new CellStyle();
        dayNameCellStyle.cellAlignment = CalendarCellAlignment.HorizontalCenter;
        dayNameCellStyle.cellTextSize = 14;
        dayNameCellStyle.effectiveHeight = 30;
        dayNameCellStyle.effectiveMarginBottom = 20;
        weekViewStyle.dayNameCellStyle = dayNameCellStyle;

here's the link to the playground

1 个答案:

答案 0 :(得分:1)

我认为插件中没有显示更改高度的选项,但是您可以使用已加载事件中的本机方法调用来实现。

onLoaded(event) {
    const calendar = event.object;
    if (calendar.android) {
        calendar.android.setDayNamesHeight(layout.toDevicePixels(40));
    } else {
        calendar.ios.presenter.style.dayNameCellHeight = 40;
    }
}

Updated Playground