CollapsingToolbarLayout和FloatingActionButton(CollapsingToolbarLayout and FloatingActionButton)
我有
CollapsingToolbarLayout
和两个FloatingActionButtons
。 只有在Toolbar
展开时,这些FAB才可见。 何时折叠,它们是隐藏的。 我需要它们可见,如果工具栏也崩溃了。 我该怎么做?非常感谢提示...
<?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout 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:fitsSystemWindows="true" tools:context=".CalendarEventInsUpdActivity"> <android.support.design.widget.AppBarLayout android:id="@+id/app_bar" android:layout_width="match_parent" android:layout_height="@dimen/app_bar_height" android:fitsSystemWindows="true" android:theme="@style/AppTheme.AppBarOverlay"> <android.support.design.widget.CollapsingToolbarLayout android:id="@+id/toolbar_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" app:contentScrim="?attr/colorPrimary" app:layout_scrollFlags="scroll|exitUntilCollapsed"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" app:layout_collapseMode="parallax" app:popupTheme="@style/AppTheme.PopupOverlay"/> </android.support.design.widget.CollapsingToolbarLayout> </android.support.design.widget.AppBarLayout> <include layout="@layout/content_calendar_event"/> <android.support.design.widget.FloatingActionButton android:id="@+id/btnSave" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="@dimen/fab_margin" android:src="@android:drawable/ic_menu_save" app:backgroundTint="@android:color/holo_green_light" app:layout_anchor="@id/app_bar" app:layout_anchorGravity="bottom|center"/> <android.support.design.widget.FloatingActionButton android:id="@+id/btnCancel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="@dimen/fab_margin" android:src="@android:drawable/ic_menu_revert" app:backgroundTint="@android:color/holo_red_light" app:layout_anchor="@id/app_bar" app:layout_anchorGravity="bottom|end"/> </android.support.design.widget.CoordinatorLayout>
I have
CollapsingToolbarLayout
and inside twoFloatingActionButtons
. These FABs are visible only when theToolbar
is expanded. When is collapsed, they are hidden. I need them visible, if toolbar is collapsed too. How can I do it?Thanks a lot for tips...
<?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout 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:fitsSystemWindows="true" tools:context=".CalendarEventInsUpdActivity"> <android.support.design.widget.AppBarLayout android:id="@+id/app_bar" android:layout_width="match_parent" android:layout_height="@dimen/app_bar_height" android:fitsSystemWindows="true" android:theme="@style/AppTheme.AppBarOverlay"> <android.support.design.widget.CollapsingToolbarLayout android:id="@+id/toolbar_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" app:contentScrim="?attr/colorPrimary" app:layout_scrollFlags="scroll|exitUntilCollapsed"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" app:layout_collapseMode="parallax" app:popupTheme="@style/AppTheme.PopupOverlay"/> </android.support.design.widget.CollapsingToolbarLayout> </android.support.design.widget.AppBarLayout> <include layout="@layout/content_calendar_event"/> <android.support.design.widget.FloatingActionButton android:id="@+id/btnSave" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="@dimen/fab_margin" android:src="@android:drawable/ic_menu_save" app:backgroundTint="@android:color/holo_green_light" app:layout_anchor="@id/app_bar" app:layout_anchorGravity="bottom|center"/> <android.support.design.widget.FloatingActionButton android:id="@+id/btnCancel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="@dimen/fab_margin" android:src="@android:drawable/ic_menu_revert" app:backgroundTint="@android:color/holo_red_light" app:layout_anchor="@id/app_bar" app:layout_anchorGravity="bottom|end"/> </android.support.design.widget.CoordinatorLayout>
原文:https://stackoverflow.com/questions/36327801
最满意答案
在您的.emacs位置
(setq-default fill-column 80)
或者您可以在填充列上使用Mx自定义变量,然后使用标准自定义界面为您设置并保存它。In your .emacs place
(setq-default fill-column 80)
Or you can just use M-x customize-variable on fill-column, and it will set it and save it for you using the standard customize interface.
相关问答
更多-
如何这样的事情: (add-hook 'markdown-mode-hook (lambda () (variable-pitch-mode t)) 然后,您可以自定义variable-pitch面,并且缓冲区中的其他面将从此继承,而不是默认面。 阅读buffer-face-mode的文档以获取更多定制细节。 (BufFace也用于text-scale-increase和text-scale-decrease ...非常有用。) How about something like this: (add-ho ...
-
在您的.emacs位置(setq-default fill-column 80)或者您可以在填充列上使用Mx自定义变量,然后使用标准自定义界面为您设置并保存它。 In your .emacs place (setq-default fill-column 80) Or you can just use M-x customize-variable on fill-column, and it will set it and save it for you using the standard customi ...
-
(customize-variable (quote tab-stop-list)) 或者将.emacs文件中的tab-stop-list条目添加到custom-set-variables中: (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file sho ...
-
你只需要在那些模式中设置fill-column ,你可以通过定义一个函数来完成这个操作并将钩子添加到相关的模式中(你也可以将它作为一个lambda ,但通常把它放在一个好的做法中)一个命名函数,所以如果你需要,你可以稍后从钩子中删除它。 *.h文件默认以c-mode ,而*.cpp文件默认以c++-mode 。 首先,定义一个函数: (defun my-c-hook () (setq fill-column 80)) 然后,将该函数添加到相关模式挂钩: (add-hook 'c-mode-hook ' ...
-
在emacs中设置自动完成模式,以便与C结构配合使用(Set up autocomplete mode in emacs to work well with C structs)[2022-12-19]
看来你需要的是CEDET /语义。 它已经内置了新的Emacs版本。 它进行代码分析,因此它将向您显示结构的有效成员。 启用语义(semantic-mode 1) 调用semantic-analyze-possible-completions来显示完成 我使用emacs -q为Emacs 24.3.1测试了它 - 它的工作原理。 还有semantic-ia-complete-symbol和许多你可能感兴趣的其他函数。 虽然auto-complete-mode确实具有ac-source-semantic ,并 ... -
有一个代码在emacs交换中解决了比wincow的wicth更少的缓冲区。 看看@JeanPierre的答案。 它使用set-window-margins参见这里的emacs手册。 这是一个交互功能,所以使用Mx my/change-window-width在从头开始评估后调用它。 (defun my/change-window-width (width) "Adjust margins so that window is centered" (interactive "NWindow width: " ...
-
如何设置emacs在verilog模式下使用3个空格而不是制表符?(How do I set emacs to use 3 spaces instead of tabs in verilog mode?)[2024-03-19]
在钩子中你应该使用setq而不是setq-default ,所以你需要将钩子重写为: (defun my-verilog-hook () (setq indent-tabs-mode nil) (setq tab-width 3)) (add-hook 'verilog-mode-hook 'my-verilog-hook) PS最好在钩子中使用专用函数,因为它更容易更改它们,你也可以从钩子中删除它们 In the hook you should use setq instead of ... -
通过“非常不同的格式化”来理解你的意思是非常有帮助的。 袒露...... 从理论上讲,您应该能够使用Mx customize-apropos org-agenda和/或在emacs配置中设置正确的org-agenda变量来实现您所寻求的目标。 您甚至可以考虑将一些函数/操作绑定在一个可用于创建/修改议程缓冲区的自定义函数中,或者您可以修改org-agenda-hook以自动执行所需的操作。 它听起来像你能够修改缓冲区以你想要的方式出现,此时的诀窍,如果我理解你正确的是弄清楚如何自动化这个过程。 另外,请考虑 ...
-
首先,你必须设置它(我只是确保你有这个部分正确): (defun my-change-log-mode-hook () (setq fill-column 120)) (add-hook 'change-log-mode-hook 'my-change-log-mode-hook) 其次,您必须确保没有覆盖此目录的本地变量设置。 例如,在编辑Emacs本身的源代码时,fill-column将设置为74以进行更改日志模式 ,将70设置为其他位置,覆盖您在μourhook中指定的值。 它们在名为.dir ...
-
从Ch v default-tab-width RET 自23.2以来,这个变量已经过时了; 使用`tab-width'代替。 和tab-width 文档: *制表位之间的距离(用于显示制表符),以列为单位。 您可以自定义此变量。 当我插入 (custom-set-variables '(tab-width 4)) 进入~/.emacs并重新启动emacs,它被设置为4 。 From C-h v default-tab-width RET This variable is obsolete since ...