小编Jon*_*nik的帖子

更改NavigationView分隔线颜色和子标题文本颜色

我正在使用android studio navigationview。
但是我将Navigationview的颜色背景更改为黑色,
并且子标题的分隔线消失了(因为分隔线也是黑色的)。
子标题标题也消失了。

有没有办法将这些属性更改为白色或任何颜色?
这是菜单的XML。

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <group
        android:id="@+id/nav_header"
        android:checkableBehavior="single">
        <item
            android:id="@+id/nav_home"
            android:checked="true"
            android:icon="@drawable/ic_home_black_24dp"
            android:title="Home" />
        <item
            android:id="@+id/nav_search"
            android:icon="@drawable/ic_search_black"
            android:title="Search Location" />
        <item
            android:id="@+id/nav_fav"
            android:icon="@drawable/ic_favorite"
            android:title="Favorites" />
        <item
            android:id="@+id/nav_recent"
            android:icon="@drawable/ic_nav_route"
            android:title="Recent Location" />
        <item
            android:id="@+id/nav_route"
            android:icon="@drawable/ic_place"
            android:title="Route" />
    </group>


    <item
        android:id="@+id/navigation_subheader"
        android:title="Others">
        <menu>
            <item
                android:id="@+id/nav_settings"
                android:checkable="true"
                android:icon="@drawable/ic_settings"
                android:title="Settings" />
            <item
                android:checkable="true"
                android:id="@+id/nav_about"
                android:icon="@android:drawable/ic_menu_send"
                android:title="About" />
        </menu>
    </item>

</menu>
Run Code Online (Sandbox Code Playgroud)

谢谢!

android navigation-drawer android-navigationview

1
推荐指数
1
解决办法
5925
查看次数

LINUX:升级生产机器

我们的生产机器在debian蚀刻上运行.现在,他们终于发布了lenny,那一天我们需要升级这些系统.如何以最小的风险做到这一点?是否有任何前提,后备方案的准备工作,如果出现问题我是否需要计划B?除了debian安装程序处理的二进制包之外,还有一些在机器上运行的已编译应用程序.

linux sysadmin debian upgrade

0
推荐指数
1
解决办法
608
查看次数

动态LotusScript多维数组

我只是做了一些yicky代码,我想,而不是使用三个动态数组,如下:

dim x()为字符串,y()为字符串,z()为字符串

拥有一个三维动态数组会更好.但; 帮助和我的摸索实验没有揭示定义它们的方法.

这不起作用:

dim x()()或dim(,2)或dim(,)

任何人的想法?

lotus-notes lotusscript lotus-domino

0
推荐指数
1
解决办法
8775
查看次数

Java中现在使用的主要工具/框架是什么?

我是一名转换到Java的.NET/C++程序员.我之前在大学时曾接触过Java 10多年前的Java.

为了能够用Java编写Web应用程序,需要学习哪些典型的东西?

我能想到:JSP/Servlets Eclipse EJB

这些天人们还用什么?

我们的想法是能够登陆Java项目并使自己变得有用

java java-ee

0
推荐指数
1
解决办法
5222
查看次数

框架的使用

我个人不喜欢使用Frameworks,我认为它会让你摆脱语言的基础......你们对此有何看法......

frameworks

0
推荐指数
1
解决办法
248
查看次数

在新行上显示每个元素的数组列表?

码:

ArrayList <Integer> marks = new ArrayList();

private void addButtonActionPerformed(java.awt.event.ActionEvent evt) {
    Collections.addAll(marks, (Integer.parseInt(markInput.getText())));
    marks.add(Integer.parseInt(markInput.getText()));
    for (int j =0; j < marks.size(); j++) {
        markdisplayTextArea.setText(Integer.toString(marks.get(j)));
}
Run Code Online (Sandbox Code Playgroud)

当用户输入JTextArea并按下"添加"按钮时,该程序应该在JTextArea的新行上显示每个数字.

它显示每个数字,但一次只显示一个.我希望输入的每个数字都以升序显示在新行上.因此,如果用户输入了4个数字,比如78,92,54和21,我希望它们显示如下:

21
54
78
92

java swing arraylist jtextarea

0
推荐指数
1
解决办法
9483
查看次数

如何添加1dp边框(到图像),以便它可以在所有屏幕上工作?

我正在寻找一种最简单,最可靠的方法来为一个元素添加一个瘦(1dp)边框 - 在这种情况下ImageView- 在API级别14+上.

根据我的理解,图层列表是执行此类操作的方法.

那么,我有什么:

<ImageView
    android:id="@+id/overlay_main_character"
    android:layout_height="72dp"
    android:layout_width="72dp"        
    android:background="@drawable/image_border"
    />
Run Code Online (Sandbox Code Playgroud)

在Java中,ImageView设置为显示此200x200像素图像 (Wikimedia Commons).

并在res/drawable/image_border.xml:

<!-- Adds thin (1dp) border, and nothing else. -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

    <item>
        <shape android:shape="rectangle" >
            <stroke android:width="1dp" android:color="#FF000000" />
            <solid android:color="@android:color/transparent"/>
        </shape>
    </item>

    <item>
        <shape android:shape="rectangle">
            <padding android:top="1dp" />
            <padding android:bottom="1dp" />
            <padding android:left="1dp" />
            <padding android:right="1dp" />
        </shape>
    </item>

</layer-list>
Run Code Online (Sandbox Code Playgroud)

它在测试设备上的样子(Galaxy Note,Android 4.1.2):

在此输入图像描述

左边和底边缺失.

我究竟做错了什么?我的图层列表方法是否不正确(或者可以简化)?或者这可以使用除图层列表以外的其他东西来实现吗?

android border android-layout android-imageview

0
推荐指数
1
解决办法
1360
查看次数

如何在发布模式下导出APK时解决以下错误?

    :app:proguardDebug
Warning:com.google.common.base.Absent: can't find referenced class javax.annotation.Nullable

Warning:com.google.common.collect.Collections2: can't find referenced class javax.annotation.Nullable

Warning:com.google.common.collect.Tables$UnmodifiableTable: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeBasedTable$TreeRow: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeMultimap: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeMultiset: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeMultiset$Aggregate: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeMultiset$Aggregate$1: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeMultiset$Aggregate$2: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeMultiset$AvlNode: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeMultiset$Reference: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeRangeMap: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeRangeMap$1: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeRangeMap$AsMapOfRanges: …
Run Code Online (Sandbox Code Playgroud)

android android-proguard

0
推荐指数
1
解决办法
2746
查看次数

Linux发行版名称解析

我选择这种方式获取linux发行版名称:

ls /etc/*release
Run Code Online (Sandbox Code Playgroud)

现在我必须解析它的名字:

/etc/<name>-release

def checkDistro():
    p = Popen('ls /etc/*release' , shell = True, stdout = PIPE)
    distroRelease = p.stdout.read()

    distroName = re.search( ur"\/etc\/(.*)\-release", distroRelease).group()
    print distroName
Run Code Online (Sandbox Code Playgroud)

但这会打印出distroRelease中的相同字符串.

python regex linux

-1
推荐指数
2
解决办法
445
查看次数

System.out.printf(“%-15s%03d \ n”,s1,x)有什么作用?

String s1=sc.next();
int x=sc.nextInt();
System.out.printf( "%-15s%03d\n", s1, x);
Run Code Online (Sandbox Code Playgroud)

有人可以解释“ printf”括号内的部分吗?

java printf

-2
推荐指数
1
解决办法
1万
查看次数

字符串不区分大小写

我现在有这个(以及更多),并希望这样做,如果有人从数组中输入非大写的东西(它当前都是大写),那么他们仍然可以订购它.

if(food.equals(array[0])) {
    System.out.println("Here is your " + food + ".");
}
Run Code Online (Sandbox Code Playgroud)

java string comparison case-insensitive

-3
推荐指数
1
解决办法
1434
查看次数