草庐IT

material-calendarview

全部标签

android - 如何在 Material Design 工具栏上添加搜索按钮

我正在尝试在设置弹出窗口的左侧添加搜索按钮,但我无法在工具栏中添加。这是我的menu.xml代码:这是我的toolbar.xml:我得到工具栏但没有得到搜索按钮? 最佳答案 像这样在您的菜单文件夹中添加menu_search.xml。并在您的Activity类中覆盖此方法@OverridepublicbooleanonCreateOptionsMenu(Menumenu){getMenuInflater().inflate(R.menu.menu_search,menu);//Associatesearchableconfigura

android - 让一个按钮在波纹动画结束时执行 OnClickListener( Material 主题)

我观察到Android中按钮上的波纹动画错误。基本上,我有一个ViewGroup,称它为包含2个按钮的ButtonContainer,称它们为OkButton和CancelButton。当用户单击CancelButton时,我想通过将其可见性设置为GONE来隐藏ButtonContainer。但这会导致副作用,即CancelButton上的波纹动画已排队,但从未播放过,而是在下一次ButtonContainer可见时播放。这似乎是因为按钮的OnClickListener在波纹动画有机会播放之前被触发。本文描述了这个确切的错误并显示了View的行为方式:link作者提出了一个解决方法,但

android - Android v21 中的样式化 Material 按钮

我正在尝试为Lollipop及以上(21+)的设备保持Material设计涟漪效应,并对按钮进行样式化,使其周围没有很大的边距/空间。示例1:具有波纹效果但有边距/间隙的按钮:示例2:没有波纹效果且没有边距/间隙的按钮:我想要Example2的布局,它具有Example1中使用的涟漪效果。示例1我的styles-v21是什么样的:...otherstyles...#ff3b59980dp@style/Widget.AppCompat.Button.Borderless#ffdd4b390dp@style/Widget.AppCompat.Button.Borderless#ff55ac

android - Google Material design android 中的扩展面板

我只是在寻找android(Material设计)中扩展面板的示例。https://www.google.com/design/spec/components/expansion-panels.html我知道我们有可扩展的ListView。但是,我需要在扩展每个面板时显示一些额外的布局View,类似于AccordianView。我们如何在Android中实现这一点? 最佳答案 试试可扩展布局here.它可以具有与Accordian相同的行为使用compile'com.github.aakira:expandable-layout:1

android - 如何在 AlertDialog 中显示 CalendarView?

我试图在警报对话框中显示CalendarView,但显示的只是月/年和星期几。这些是布局文件的内容:这是我用来将布局添加到AlertDialog的代码:LayoutInflaterinflater=(LayoutInflater)getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);LinearLayoutll=(LinearLayout)inflater.inflate(R.layout.myLayout,null,false);CalendarViewcv=(CalendarView)ll

android - 如何在 Android Material Design 中为 float 操作按钮创建子菜单?

我想在点击我的float操作按钮后创建一个子菜单,如下所示:我已经知道这个库了:https://github.com/futuresimple/android-floating-action-button但是我想用androidsupportdesign的nativeFAB来创建这个:compile'com.android.support:design:23.+'和 最佳答案 直接是不可能的。android.support.design.widget.FloatingActionButton是ImageView的子类,它不能承载ch

android - PlacePicker 不选择 Material 主题

我正在使用GooglePlay服务中的PlacePicker库来启动新Activity。新的Activity/选择器有一个默认没有样式的工具栏(actionbar)。PlacePicker文档指出Ifyousetcustomcolorsinyourapplicationusingthematerialtheme,theplacepickerinheritsthecolorPrimaryandcolorPrimaryDarkattributesfromthetheme.我的style.xml文件中有一个主题:#5665bb#5665bb#41456b#41456b并且我已经设置了要在我的

android - Material 设计中缺少 ActionBar

我想使用AndroidStudio和新Material设计开发一个Android应用程序,它在Android5.0上看起来很棒,但是当我在我的4.4.2手机上测试该应用程序时,该应用程序的ActionBar不见了。这是我的list:样式.xml和build.gradleapplyplugin:'com.android.application'android{compileSdkVersion21buildToolsVersion"21.0.0"defaultConfig{applicationId"com.example.app"minSdkVersion14targetSdkVers

android - 全宽按钮 Material 对话框

我正在尝试找到一个示例代码来实现带有全宽按钮的Material对话框,如下面的屏幕截图所示。有人可以通过分享有关如何复制此设计的示例代码来提供帮助吗? 最佳答案 您可以通过仅使用AppCompat来实现,请查看我的解决方法:代码importandroid.support.v7.app.AlertDialog;AlertDialog.Builderbuilder;builder=newAlertDialog.Builder(context,R.style.StackedAlertDialogStyle);builder.setTitl

android - 如何去除 ToggleButton 的 Material 阴影?

今天我遇到了一个问题:在我的自定义布局中,有灰色背景的LinearLayout和在此LinearLayout内的TextView之后的ToggleButton。切换按钮具有透明背景。但是在androidLollipop这里有不必要的影子。我试过elevation=0dp属性。但这并没有解决我的问题。当我设置api=21时会发生这种情况这发生在这是示例布局:如何去掉这个阴影? 最佳答案 尝试使用style="@android:style/Widget.Holo.Button.Borderless将小部件更改为appcompat(或任何