我想添加半透明的状态栏和导航到我的应用程序(对于kitkat),并在大多数地方它运作良好.
我有一个主题:
<item name="android:windowTranslucentNavigation">true</item>
<item name="android:windowTranslucentStatus">true</item>
Run Code Online (Sandbox Code Playgroud)
在我的布局中我有 android:fitsSystemWindows="true"
对于正常活动,这很好,但我有两个麻烦的活动. - >内容显示在状态栏和我的操作栏后面.
其中一个是PreferenceActivity我通过添加修复它 findViewById(android.R.id.list).setFitsSystemWindows(true);
第二个是一个活动,ActionBar.NAVIGATION_MODE_TABS
在那里我找不到正确的setFitsSystemWindows(true)
呼叫目标.
我试过findViewById(android.R.id.content)
和findViewById(android.R.id.tabcontent)
.我还尝试将xml属性添加到我的片段的布局中但没有成功.
我只是决定用spring-boot和thymeleaf开始一个小项目.
thymeleaf本身看起来很棒直到现在,但我的问题是什么是最好的方法,例如layout.html带来页面的基本布局
喜欢
- 常见的css包含
- 常见的js包含
- 基本结构(例如2/3列布局)
包含在单个页面的内容(查看博客文章,查看评论,在库中查看图像等),我不需要将常见的东西带入所有模板.
到目前为止,我找到的唯一方法是使用片段包含但我不确定这是否是正确的方法来获得模板的完整结构我想为当前请求呈现
比如我如何得到<div class="content"></div>
我的模板?
我希望有人能帮帮忙.
提前致谢
我正在使用spring框架v4.1.7并且在调度cron任务时遇到问题,我想在属性文件中定义cron参数.
我的java代码:
@Scheduled(cron = "${invoice.export.cron}")
private void scheduledExport() {
// ... the code to execute ...
}
Run Code Online (Sandbox Code Playgroud)
在我的属性文件中,我必须invoice.export.cron: 0 0 7 * * MON-FRI?
启用我@EnableScheduling
在主配置类上的调度.
我试图调试这个问题,发现应该从属性占位符这里解析cron表达式.跟着电话进入resolveStringValue
我的这个位置AbstractBeanFactory
.而且据我所知,这是问题所在.该this.embeddedValueResolvers
列表是空的...因此它不能解决我传递到属性@Scheduled(cron)
.
任何人都有一个想法,如果我做错了什么或错过了什么?
提前致谢!:)
可能重复:
如何判断是否在android中删除了通知阴影
几周前,一位朋友在他的Galaxy Note2上向我展示了一个闹钟应用程序,如果你拉下通知栏,警报会停止.
我想知道如何获得通知栏的下拉事件,我尝试谷歌搜索,也在这里搜索SO.我发现的只是"如何显示您的通知"或"下载列表视图的下拉"等.
我希望有人能够实现这一目标.或者可以给我一个提示.
提前致谢 :)
我想创建一个DatabaseConfig类来设置我的数据库相关的东西(EntityManager,DataSource,TransactionManager)并获取我@Value("${property.name}")
在String
字段上使用的属性
喜欢
@Configuration
public class DataBaseConfig {
@Value("${hibernate.connection.username}")
private String hibernateConnectionUsername;
@Value("${hibernate.connection.password}")
private String hibernateConnectionPassword;
@Value("${hibernate.connection.driver_class}")
private String hibernateConnectionDriverClass;
@Value("${hibernate.connection.url}")
private String hibernateConnectionUrl;
@Value("${hibernate.dialect}")
private String hibernateDialect;
@Value("${hibernate.showSql}")
private String hibernateShowSql;
@Value("${hibernate.generateDdl}")
private String hibernateGenerateDdl;
// All my @Beans
}
Run Code Online (Sandbox Code Playgroud)
问题是,所有这些字符串都是NULL而不是我的属性文件的值.
如果我把代码放入我的Application
类(具有main
和引用的那个SpringApplication.run(Application.class, args);
)中,值注入工作
简而言之,@ Value在我的Application类中工作,但不在我的自定义@Configuration类中:(
可能有什么不对?或者需要更多信息?
更新:更多代码
我的Application.java中的方式1,DB Config和@Value使用和不使用PropertySourcesPlaceholderConfigurer
import java.beans.PropertyVetoException;
import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration; …
Run Code Online (Sandbox Code Playgroud) 我查询了 cassandra 表并选择了 curent_time,如下所示:
Dataset getTime = spark.sql("select current_time from trafficdata where current_time between "+ time1 +" and "+ time2 );
getTime.show();
List<Rows> list = getTime.collectAsList();
Run Code Online (Sandbox Code Playgroud)
我想将其转换List<Rows>
为List<Long>
. 有谁知道怎么做?
我正在更新我的应用程序以使用片段而不是活动,以便以后为平板电脑制作更好的ui.因为我有minSdk = 14我认为我可以扔掉support.v4但现在我想要一个带有一些标签子片段的片段.我发现没有支持库的唯一方法是ActionBar标签的东西.但对于平板电脑,我希望有这样的东西
左:单个片段(不更改)
右:更改片段,其中一些片段可以包含制表符
我希望标签仅在右侧可见,而不是在两侧上方的操作栏级别.是否有一种方法(值得努力)没有support.v4这样做或者我应该重做代码我必须使用support.v4片段类,我可以使用support.v4 lib提供的FragmentTabHost?
android ×3
java ×2
spring ×2
spring-boot ×2
android-4.0-ice-cream-sandwich ×1
apache-spark ×1
cassandra ×1
statusbar ×1
templates ×1
thymeleaf ×1