小编Mic*_*ico的帖子

如何安装Android Z命令?

在我的应用程序中,我想在背景图像上绘制.我有以下xml:

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/bg2"
>
    <com.myapp.drawings.DrawingSurface
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:id="@+id/drawingSurface"
    />
    <LinearLayout
            android:orientation="horizontal"
            android:background="@drawable/bg2" 
            android:layout_width="match_parent" 
            android:layout_height="match_parent">
        <Button
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:text="OK"
                android:onClick="onClick"
                android:id="@+id/colorBlueBtn"
        />
        <Button
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:text="Save"
                android:onClick="onClick"
                android:id="@+id/saveBtn"
        />
    </LinearLayout>
</FrameLayout>
Run Code Online (Sandbox Code Playgroud)

不,问题是,当我尝试在绘图表面上绘图时,我的绘图没有显示.显示了背景图像和按钮.一旦我保存它,我的应用程序生成的图像文件就会显示出来.我认为问题是我的布局的Z顺序.

有任何想法吗?谢谢你的帮助!:)

android android-layout android-framelayout

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

加载数据infile,用逗号处理字段

在使用加载数据时,我们如何使用逗号处理字段?我有这个查询:

$sql = "LOAD DATA LOCAL INFILE '{$file}' INTO TABLE sales_per_pgs 
        FIELDS TERMINATED BY ','
        LINES TERMINATED BY '\n'
        IGNORE 1 LINES
        (@user_id, @account_code, @pg_code, @sales_value)
        SET
        user_id = @user_id, 
        account_code = @account_code,
        product_group_code = @pg_code,
        sales_value = REPLACE(@sales_value, ',', ''),
        company_id = {$company_id},
        year = {$year},
        month = {$month}";
Run Code Online (Sandbox Code Playgroud)

并且来自csv的一行看起来像这样:

139, pg89898, op89890, 1,000,000.00
Run Code Online (Sandbox Code Playgroud)

哪里1,000,000.00是销售价值....

目前,我的数据库中只插入了什么 "1

有任何想法吗?提前致谢...

编辑

用户下载包含以下列的表单:

user id,account id,pg id,sales value

其中前三个栏user id,account id …

php mysql load-data-infile

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

Joda时间格式无效

当我尝试使用Joda时间执行此代码时出错:

// yyyy-mm-dd, also tried 17-Feb-2013
String input = "2013-02-17";

DateTimeFormatter formatter = DateTimeFormat.forPattern("dd/MM/yyyy");
DateTime dt = formatter.parseDateTime(input);

TextView tv = (TextView) findViewById(R.id.tvShow);
tv.setText("HERE >>> " + dt.toString());
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

logcat说:

03-18 16:58:14.919: W/System.err(8259): java.lang.IllegalArgumentException: Invalid format: "2013-02-17" is malformed at "13-02-17"
03-18 16:58:14.919: W/System.err(8259):     at org.joda.time.format.DateTimeFormatter.parseDateTime(DateTimeFormatter.java:871)
03-18 16:58:14.919: W/System.err(8259):     at com.example.dateformatter.MainActivity.onCreate(MainActivity.java:42)
03-18 16:58:14.919: W/System.err(8259):     at android.app.Activity.performCreate(Activity.java:5163)
03-18 16:58:14.919: W/System.err(8259):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
03-18 16:58:14.919: W/System.err(8259):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2061)
03-18 16:58:14.919: W/System.err(8259):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2122)
03-18 16:58:14.919: W/System.err(8259):     at android.app.ActivityThread.access$600(ActivityThread.java:140)
03-18 16:58:14.919: W/System.err(8259):     at …
Run Code Online (Sandbox Code Playgroud)

android jodatime

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

如何在逗号分隔的字符串中选择一个数字?

我的MySQL表中有一列.列名称为"attached_products",现在,例如我在那里有一些记录,且attachment_products的值为"1,16,164,1645",如何选择"16"的所有记录?

我尝试了where子句,它类似于:

select * from websites where attached_products like '%16%'
Run Code Online (Sandbox Code Playgroud)

但它也选择164和21645的记录.

谢谢你的帮助!:)

php mysql database select

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