我有以下测试底页实现.
当我将peekHeight设置为小于500的值时,它可以工作.经过一定的价值后,偷看高度的任何增加都不会改变底部纸张的展开方式.它只是留在那里只能手动拖动.我们如何以编程方式设置peekHeight以确保底部工作表自动扩展到查看高度.
bottom_sheet_dialog_main
<?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"
android:id="@+id/locUXCoordinatorLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/locUXView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:orientation="vertical"
app:behavior_hideable="false"
app:behavior_peekHeight="0dp"
app:layout_behavior="@string/bottom_sheet_behavior">
<TextView
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="1 Value" />
<TextView
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="2 Value" />
<TextView
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="3 Value" />
<TextView
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="4 Value" />
<TextView
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="5 Value" />
<TextView
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="6 Value" />
<TextView
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="7 Value" />
<TextView
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="8 Value" />
<TextView
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="9 Value" />
<TextView
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="First Value" …Run Code Online (Sandbox Code Playgroud) java android android-support-library android-support-design bottom-sheet
我YYYY-mm-DD HH:MM:SS在我的JSON中转换了格式的DateString,并使用代码保存到POJO
DateTimeFormatter format = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
this.startDate = format.parseDateTime(startDate);
Run Code Online (Sandbox Code Playgroud)
当我将POJO转换回JSON时,日期就像是2013-07-12T18:31:01.000Z.
我们如何将时间字符串解析2013-07-12T18:31:01.000Z回JodaDateTime对象.什么应该格式化.
我用过YYYY-mm-DD HH:MM:SS,但没用
我创建的片段取决于其父活动的几个属性。我浏览了片段生命周期文档。我需要将活动的副本存储在一个变量中,以便我以后可以访问它。有两个地方,我可以做到这一点
哪个是推荐的最佳地点,为什么?曾出现过调用onAttach ()后片段中getActivity返回null的情况
刚刚在Mac山狮上使用brew安装了CouchDb.一切顺利,直到我遇到以下问题启动服务器我不知道erlnag并且无法分析转储文件
`couchdb
Apache CouchDB 1.2.1 (LogLevel=info) is starting.
{"init terminating in do_boot",{{badmatch,{error,{bad_return,{{couch_app,start,[normal,["/usr/local/etc/couchdb/default.ini","/usr/local/etc/couchdb/local.ini"]]},{'EXIT',{{badmatch,{error,shutdown}},[{couch_server_sup,start_server,1,[{file,"couch_server_sup.erl"},{line,98}]},{application_master,start_it_old,4,[{file,"application_master.erl"},{line,274}]}]}}}}}},[{couch,start,0,[{file,"couch.erl"},{line,18}]},{init,start_it,1,[]},{init,start_em,1,[]}]}}
Crash dump was written to: erl_crash.dump
init terminating in do_boot ()`
Run Code Online (Sandbox Code Playgroud)
任何帮助非常感谢.我已经保留了配置文件
我正在使用intellij和我的代码使用
import javax.xml.bind.annotation.XmlRootElement;
它在我使用命令行时编译并运行.但是,当尝试使用ide(intellij)运行测试类时,它会给出错误
package javax.xml.bind.annotation does not exists
我在我的pom.xml中添加了jaxb依赖项
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.0</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
什么力量intellij不发现这个?
要创建 UTC 日期对象,我们可以编写
new Date(Date.UTC(2012,02,30));
Run Code Online (Sandbox Code Playgroud)
如果没有 Date.UTC,它将获取locale并创建Date对象。如果我必须创建一个 Date 对象来CET在世界的某个地方运行程序,我会怎么做?
我正在注释我的函数@Loggable jcabi注释.它记录的语句不完整,它修剪了行,只打印..为截断的数据.我希望打印整行.可以使用此注释完成此操作.
@Loggable(Loggable.DEBUG)
public String load(URL url) {
return url.openConnection().getContent();
}
Run Code Online (Sandbox Code Playgroud)
生成以下日志
[DEBUG] #load('http://www.google.com'): returned "<html ..." in 23ms
Run Code Online (Sandbox Code Playgroud)
Log4j.properties
# Root logger option
log4j.rootLogger=INFO, file, CONSOLE
# Direct log messages to a log file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=swami-plugin.log
log4j.appender.file.MaxFileSize=10MB
log4j.appender.file.MaxBackupIndex=1
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=com.jcabi.log.MulticolorLayout
log4j.appender.CONSOLE.layout.ConversionPattern=[%color{%-5p}] %c: %m%n
Run Code Online (Sandbox Code Playgroud) 我有一个复杂的模型类,Java其中具有不同类的属性。我想以 yml 格式获取类的模式,以提高可读性。我能够将类的结构转换为 JSON 文件,但我觉得 yml 不那么混乱且易于准备。
示例 来自
public class Phone {
public String name;
public String number;
}
Run Code Online (Sandbox Code Playgroud)
到
Phone:
fields:
name:
type: String
number:
type: String
Run Code Online (Sandbox Code Playgroud) 我有基本类型转换的问题.
#include<stdio.h>
int main()
{
printf("%.22f",0.30);
return 1;
}
Run Code Online (Sandbox Code Playgroud)
我得到的输出是0.2999999999999999888978
为什么0.3转换为较小的值
任何帮助非常感谢
Nandish