我有这个对话框类,我想将图标设置为其标题:
public class DialogMealInformation extends Dialog implements
android.view.View.OnClickListener {
Context context;
private TextView tv_information;
private Button b_ok;
private String information;
public DialogMealInformation(Context context, String information) {
// TODO Auto-generated constructor stub
super(context);
this.context = context;
this.information = information;
setContentView(R.layout.dialog_meal_information);
getWindow().setLayout(android.view.ViewGroup.LayoutParams.FILL_PARENT,
android.view.ViewGroup.LayoutParams.WRAP_CONTENT);
setTitle("Info !");
initialize();
}
Run Code Online (Sandbox Code Playgroud)
它尝试这样:
setTitle(R.layout.dialog_simple_header);
Run Code Online (Sandbox Code Playgroud)
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<TextView
android:id="@+id/tv_dialog_simple_header_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/tv_information"
android:drawableLeft="@drawable/more_information" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
但之后的标题是"res/layout/dialog_simple_header.x"只是文字,没有出现图标,请问为什么,解决方案是什么,非常感谢
我有两个按钮,我想把它们水平放置,因此它们将在屏幕上彼此相邻,没有空间,我知道我可以用线性布局和设置重量做但我想要相对布局因为我已经在我的XML中有重量所以将两个权重放在一起会是不好的表现.
我试过这样的
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_selector" >
<Button
android:id="@+id/b_orderMeal_send"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="4dip"
android:layout_marginRight="4dip"
android:background="@drawable/button_selector"
android:clickable="true"
android:focusable="true"
android:text="@string/b_send"
android:textColor="#FFFFFF" />
<Button
android:id="@+id/b_orderMeal_cancel"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerHorizontal="true"
android:layout_marginLeft="4dip"
android:layout_marginRight="4dip"
android:background="@drawable/button_selector"
android:clickable="true"
android:focusable="true"
android:text="@string/b_cancel"
android:textColor="#FFFFFF" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
但只是取消按钮出现,这是因为我使用"填充父",请问有什么解决方案?
我有这样的字符串
"1st January 2014"
Run Code Online (Sandbox Code Playgroud)
我想把它格式化为日期.
如果日期是datetime.date
我做的:1 January 2014那么replace(' ','')
但是当有一天这不工作datetime.strptime(SecondDateString, "%d%B%Y").date() st nd,或rd
请帮忙
你可能会说,我自己删除th,st,nd,或rd再使用上面我自己的方式,是的,这是一个解决方案,但我问蟒蛇已经alreayd了我的东西
我有这本字典
Dictionary<string, List<double[]>> dictionary = new Dictionary<string, List<double[]>>();
Run Code Online (Sandbox Code Playgroud)
我填写了大量数据.
列表中的每个数组都有两个值,如下所示:
[xvalue, yvalue]
Run Code Online (Sandbox Code Playgroud)
无论如何,我可以根据xvalue数组排序字典中的每个列表.
这是清单
[[1,100], [10, 100], ....[3, 100]]
Run Code Online (Sandbox Code Playgroud)
[[1,100], [3,100], [10,100]]
Run Code Online (Sandbox Code Playgroud)
说实话,我所做的只是谷歌搜索这样一个功能,但我不能做更多,因为我在c#中不是那么好,我想你会节省很多时间.
我有这个字符串:
string s = "[\"default\",\"direct\"]";
Run Code Online (Sandbox Code Playgroud)
我想创建一个数组,所以最后的数组应该是这样的:
["default", "direct"]
Run Code Online (Sandbox Code Playgroud)
string[] ss = s.Split(',');
Run Code Online (Sandbox Code Playgroud)
但结果是:

我有一个DataTable,我像这样初始化它:
dataTable = new DataTable();
dataTable.Clear();
for (int i = 0; i < labels.Length; i++)
{
dataTable.Columns.Add(MyCSVReaderFinal.labels[i]);
}
return dataTable;
Run Code Online (Sandbox Code Playgroud)
label像这样的字符串数组在哪里:
private static string[] labels = { "FARM ID", "FARM OWNER ARABIC", "FARM NUMBER",
"FARM MOBILE", "EMAR NAME ARABIC", "EMARA ID", "AREA NAME ARABIC", "AREA ID",
"REGION NAME ARABIC", "REGION ID", "RECEIVING CENTER NAME ARABIC",
"RECEIVING CENTER ID", "KHALAS", "FARDH", "OTHER LULU", "KHENAIZI", "BOUMAAN",
"BARHI", "JESH KHARMA", "REZIZ", "JABRI", "ANBARET AL-MADINA", "SHISHI",
"DABBAS", "NABTET SAIF", "KHEDRAWI", "HILALI", …Run Code Online (Sandbox Code Playgroud) 我在服务器上安装了oracle 11 gr 2,并下载ODAC112040Xcopy_64bit并安装了.net组件.
我Oracle.DataAccess.dll将此位置中存在的内容 复制Oracle_Folder\odp.net\bin\4到binVisual Studio项目中的文件夹中
当我执行我的代码时,我遇到了这个异常:
TestOracleConnection.exe中发生了未处理的"System.BadImageFormatException"类型异常
附加信息:无法加载文件或程序集"Oracle.DataAccess,Version = 4.112.4.0,Culture = neutral,PublicKeyToken = 89b483f429c47342"或其依赖项之一.尝试加载格式不正确的程序.
我的代码是:
public string CallCardDetails(string CallCardNo)
{
//initialize
using (DataSet ds = new DataSet())
{
//connect
using (OracleConnection conn = new OracleConnection("User Id=oraDB;Password=ora;Data Source=CCT"))
{
// Oracle uses : for parameters, not @
string query = "SELECT idcard from CallCardTable where idcard= :pCallCardNo";
// Let the using block dispose of your OracleCommand
using (OracleCommand cmd = …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Protégé来构建我的OWL本体
在构建一些数据属性的同时,我发现OWL有两种类型:non negative integer和positive integer:它们之间有什么区别?
这是我的Java代码:
@POST
@Path("/sumPost")
@Produces(MediaType.TEXT_PLAIN)
public String sumPost(@QueryParam(value = "x") int x,
@QueryParam(value = "y") int y) {
System.out.println("x = " + x);
System.out.println("y = " + y);
return (x + y) + "\n";
}
Run Code Online (Sandbox Code Playgroud)
我这样称呼它:
curl -XPOST "http://localhost:8080/CurlServer/curl/curltutorial/sumPost" -d 'x:5&y:3'
Run Code Online (Sandbox Code Playgroud)
问题是System.out.println呼叫一直张贴零零,看来我没有正确传递 x 和 y。
得到答复后,我将请求更改为:
curl -d '{"x" : 4, "y":3}' "http://localhost:8080/CurlServer/curl/curltutorial/sumPost" -H "Content-Type:application/json" -H "Accept:text/plain" --include
Run Code Online (Sandbox Code Playgroud)
服务是:
@POST
@Path("/sumPost")
@Produces(MediaType.TEXT_PLAIN)
@Consumes(MediaType.APPLICATION_JSON)
public String sumPost(@QueryParam(value = "x") int x,
@QueryParam(value = "y") int y) {
System.out.println("sumPost");
System.out.println("x …Run Code Online (Sandbox Code Playgroud) 我可以这样获取当前时间:
import datetime
str(datetime.date.today().strftime("%Y-%m-%d"))
Run Code Online (Sandbox Code Playgroud)
打印
2016-06-26
但我需要添加分钟,秒和小时
我在互联网上搜索,人们建议使用此功能:
str(datetime.date.today().strftime("%Y-%m-%d %H:%M"));
Run Code Online (Sandbox Code Playgroud)
但实际上%H:%M回报00:00总是
你能帮我吗 ?
c# ×4
android ×2
python ×2
python-2.7 ×2
.net ×1
android-xml ×1
arrays ×1
collections ×1
curl ×1
datatable ×1
date ×1
datetime ×1
dictionary ×1
http-post ×1
java ×1
jersey ×1
ontology ×1
oracle ×1
owl ×1
protege ×1
semantic-web ×1
semantics ×1
sorting ×1