小编Mer*_*ian的帖子

如何在与父级底部对齐的CardView上添加阴影

我有一个CardView对齐底部屏幕,尽管我希望在CardView顶部添加更多阴影.我试过了

  android:shadowColor="#000"
  android:shadowDx="0"
  android:shadowDy="30"
  android:shadowRadius="50"
Run Code Online (Sandbox Code Playgroud)

但是看到没有变化这是我的代码:

    <RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:clipToPadding="false"
        android:clipChildren="false"
         android:orientation="vertical"
         android:layout_width="match_parent"
         android:layout_height="match_parent">

    <!--rest of the code-->

     <LinearLayout
            android:layout_width="match_parent"
            android:layout_alignParentBottom="true"
            android:shadowColor="#000"
            android:shadowDx="0"
            android:shadowDy="30"
            android:shadowRadius="50"
            android:layout_height="wrap_content">
        <android.support.v7.widget.CardView      
xmlns:app="http://schemas.android.com/apk/res-auto"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:elevation="8dp"                         
             android:divider="@android:color/transparent"
             android:dividerHeight="0.0px"
             android:clipToPadding="false"
             android:clipChildren="false"
             app:cardElevation="10dp"
             app:cardPreventCornerOverlap="false">

          <!--rest of the code-->
    </android.support.v7.widget.CardView>
    </LinearLayout>

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

android shadow cardview

10
推荐指数
4
解决办法
5万
查看次数

使用带有有效值的Scanner#nextDouble的InputMismatchException

这是我的扫描仪代码:

import java.util.Scanner;
public class TryDouble {

    public static void main(String  [] args){
        Scanner jin = new Scanner(System.in);
        double a = jin.nextDouble();
        double b = jin.nextDouble();
        double c = jin.nextDouble();
        System.out.println(a + b + c);
    }
}
Run Code Online (Sandbox Code Playgroud)

输入:0.2 0.5 0.9,我得到:

Exception in thread "main" java.util.InputMismatchException
at java.util.Scanner.throwFor(Unknown Source)
at java.util.Scanner.next(Unknown Source)
at java.util.Scanner.nextDouble(Unknown Source)
at TryDouble.main(TryDouble.java:6)
Run Code Online (Sandbox Code Playgroud)

我该怎么做才能消除该错误?

java

5
推荐指数
2
解决办法
665
查看次数

如何在sql查询中获取子字符串

我正在尝试从表名称中的 int 元素中的 0-7 位置获取子字符串,因此当我插入此值时

select substring(column_name,0, 6) as new_name from table_name 
Run Code Online (Sandbox Code Playgroud)

我正进入(状态

SQL错误[42883]:错误:函数pg_catalog.substring(bigint,integer,integer)不存在

提示:没有函数与给定的名称和参数类型匹配。您可能需要添加显式类型转换。

位置:8

org.postgresql.util.PSQLException:错误:函数 pg_catalog.substring(bigint,整数,整数)不存在

提示:没有函数与给定的名称和参数类型匹配。您可能需要添加显式类型转换。位置:8

所以在向 varchar(8) 添加一些转换之后

select substring(varchar(8),column_name,0, 6) as new_name from table_name
Run Code Online (Sandbox Code Playgroud)

得到这个

SQL 错误 [42601]:错误:“,”位置或附近的语法错误:28
org.postgresql.util.PSQLException:错误:“,”位置或附近的语法错误:28

我不知道我做错了什么。谢谢。

sql substring dbeaver

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

标签 统计

android ×1

cardview ×1

dbeaver ×1

java ×1

shadow ×1

sql ×1

substring ×1