我正在显示一个表格布局,因为我想要在表格中的行之间分隔线.也可以在表格布局中进行列方式分离.请帮助我.
以下是我的xml表格布局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="6dip"
android:paddingTop="4dip">
<TableLayout
android:id="@+id/tablelayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingRight="2dip">
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Income"></TextView>
<TextView
android:layout_width="150px"
android:layout_height="wrap_content"
android:layout_marginLeft="150dp"
android:text="Expense"></TextView>
</TableRow>
<TableRow android:layout_marginTop="30px">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Household:"></TextView>
<TextView
android:id="@+id/text50"
android:layout_width="150px"
android:layout_height="wrap_content"
android:text="Household:"></TextView>
</TableRow>
<TableRow android:layout_marginTop="40px">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_span="2"
android:text="Travel:"></TextView>
<TextView
android:id="@+id/text51"
android:layout_width="150px"
android:layout_height="wrap_content"
android:layout_marginLeft="-250dp"
android:text="Travel"></TextView>
</TableRow>
<TableRow android:layout_marginTop="40px">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_span="2"
android:text="Education:"></TextView>
<TextView
android:id="@+id/text52"
android:layout_width="150px"
android:layout_height="wrap_content"
android:layout_marginLeft="-250dp"
android:text="Education"></TextView>
</TableRow>
</TableLayout>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud) 在我的应用程序中,我使用日期选择器为用户选择日期.所以我在我的应用程序中使用数据库,如果用户选择1个特定项目意味着我将获取与该项目相关的数据,我将在另一个屏幕中显示它,因为它将有1个开始日期,我必须将该日期作为日期选择器中的默认日期加载..但是它将当前日期作为默认日期加载而不是从数据库中提取的日期..请帮助我..提前谢谢.
我的代码:
c = Calendar.getInstance();
SimpleDateFormat sdf=new SimpleDateFormat("yyyy/MM/dd");
System.out.println("After format");
Date pickdefdate=null;
// String pickdefdatepar=null;
try {
System.out.println("Inside try="+date);
pickdefdate=sdf.parse(date); ----------->date which is fetched from database.
System.out.println("dddddddd="+pickdefdate);
c.setTime(pickdefdate); --------------------->Setting this date as current date..
System.out.println("After parse");
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
mYear = c.get(Calendar.YEAR); ----------as u said i am setting this value before dialog.
mMonth = c.get(Calendar.MONTH);
mDay = c.get(Calendar.DAY_OF_MONTH);
showDialog(DATE_DIALOG_ID);
protected Dialog onCreateDialog(int id)
{
switch (id) {
case DATE_DIALOG_ID:
System.out.println("in dia="+mDay); …Run Code Online (Sandbox Code Playgroud) 在我的数据库中,我有一个表date作为列之一,它存储用户在我的表中添加一些数据的日期.
现在我想单独检索当月的数据.我在谷歌搜索但没有得到适当的答案.
我的表创建代码:
"create table incomexpense(
_id integer primary key autoincrement,
"+"price text not null,description text not null,
"+"quantity text not null,
"+"total text not null,
"+"category text not null,
"+"recurrence text not null,
"+"date text not null,
"+"groups text not null,
"+" recurrenceid text not null);";
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮助如何从当前日期获取第7天的日期.
我是Python的新手,我正在尝试声明一个变量并打印它的值.
这是我的代码:
#!C:\Python32\python.exe
import sys
import os
import cgi
import cgitb
cgitb.enable()
a = 5
print(a)-------------------------> My doubt is in this line
Run Code Online (Sandbox Code Playgroud)
但是我的一个朋友写道print a.在他的Python中,它正在打印该值,但在我的情况下,它显示为"无效语法".为什么会这样?