我正在使用基础5框架(不确定是否重要).我将把所有信息传递到另一个页面,所以当我通过它时,每个CELL是一个可区分的项目/值是非常重要的,但是我不确定如何开始这个问题.它应该在每次添加时添加另一行.删除也是如此.
任何人都可以指导我如何处理这个问题?这是我的标记:
<a href="#" class="button>Add line</a>
<a href="#" class="button>Delete line</a>
<div style="width:98%; margin:0 auto">
<table align="center">
<thead>
<tr>
<th>Status</th>
<th>Campaign Name</th>
<th>URL Link</th>
<th>Product</th>
<th>Dates (Start to End)</th>
<th>Total Budget</th>
<th>Daily Budget</th>
<th>Pricing Model</th>
<th>Bid</th>
<th>Targeting Info</th>
<th>Total Units</th>
</tr>
</thead>
<tbody>
<tr>
<td>df</td>
<td>dfd</td>
<td>fdsd</td>
<td>fdsfd</td>
<td>dsf</td>
<td>dd</td>
<td>dd</td>
<td>dd</td>
<td>dd</td>
<td>dd</td>
<td>dd</td>
</tr>
</tbody>
</table>
</div>
Run Code Online (Sandbox Code Playgroud) 我已将CD刻录到终端的android工具目录中.我尝试输入'android'并点击输入,我也尝试输入'android sdk'并点击输入但是sdk经理不会出现.
任何解决方案或建议,以帮助我理解我做错了什么?
我的数字是N.N将是数组的大小.
int numArray [] = new numArray[N];
Run Code Online (Sandbox Code Playgroud)
但是,数组的内容将保持从1到正N的每个其他数字.这意味着在循环之后整个大小N数组将不会满.因此,在for循环之后,我想修剪(或调整大小)数组,以便数组中不再有任何空插槽.
示例:
假设N = 5; 这意味着,在for循环之后,从1到5的每个其他数字都将在数组中,如下所示:
int arr [] = new int [N];
int arr[0]=1;
int arr[1]=3;
int arr[2]= null;
int arr[3]= null;
int arr[4]= null;
Run Code Online (Sandbox Code Playgroud)
现在,我想在for循环之后修剪(或调整大小),以便保留null的索引将消失,然后数组应该是:
int arr[0]=1;
int arr[1]=3;
Run Code Online (Sandbox Code Playgroud)
数组的大小现在是2.
我现在基本上正在制作表格.但我的表单有"添加"和"删除"按钮以容纳额外的字段.现在,其中一个字段是"总预算"字段.
我要将所有输入字段发送到另一个页面.但是,我希望能够从所有"总预算"字段中累计完整的总金额.(请记住,有一个总预算字段,但用户可以"添加"/"删除",可能会有更多).
当我将它传递到下一页时,我想单独传递它们,并保留它们以便显示.在下一页将有一个额外的"最终总金额",我将显示它.
此外,我正在使用基础5(不确定是否重要).
现在,我不知道该怎么做.有人能指出我走向正确的方向吗?这是我标记的样子:
JAVASCRIPT:
<script>
$(document).ready(function() {
$(".add").on('click', function() {
var linehtml = $('.line').html();
var total = $('.line').length;
var dele = (total - 1);
$('#linecont').append('<div class="line"><hr />'+linehtml+'</div>');
return false;
});
$(".del").on('click', function() {
var linecont = $("#linecont");
var total = linecont.find('.line').length;
var dele = (total - 1);
if(total === 1) {
return false;
}
$('.line').eq(dele).remove();
return false;
});
});
</script>
Run Code Online (Sandbox Code Playgroud)
HTML:
<div align="center">
<a href="#" class="button add">Add Line</a>
<a href="#" class="button del">Delete Line</a>
<div style="width: 40%; margin:0 auto"> …Run Code Online (Sandbox Code Playgroud)
我的Android应用程序中有一个字符串生成器功能.我希望每次有"点击"或"触摸"时调用字符串生成器功能.然后,字符串生成器函数将更改文本标签中的字符串.我没有任何类型的错误,但是当我在Android模拟器和物理设备上测试应用程序时,文本标签中的字符串不会更改,这意味着不会调用字符串生成器函数.
这是我的代码的样子:
public class MainActivity extends Activity{
//member variables
private ExcuseGenerator mExcuseGenerator = new ExcuseGenerator();
private ImageView mMrExcuse;
private TextView mExcuse;
private RelativeLayout rl;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mMrExcuse = (ImageView) findViewById(R.id.imageView1);
mExcuse = (TextView) findViewById(R.id.textView1);
rl = (RelativeLayout) findViewById(R.id.rl1);
rl.setOnTouchListener(
new View.OnTouchListener(){
@Override
public boolean onTouch(View v, MotionEvent event) {
if(event.getAction() == MotionEvent.ACTION_UP){
//here is the string generator function
excuseGenerator();
return true;
}
return false;
}
}
);
}
Run Code Online (Sandbox Code Playgroud)
注意:我希望在屏幕上的任何位置检测点击/触摸,这就是我使用OnTouchListener的相对布局的原因.
编辑:添加了屏幕截图以显示XML文件.
编辑2:这是我的借口生成器功能:
private void excuseGenerator(){ …Run Code Online (Sandbox Code Playgroud) 我使用 codeIgniter-bootstrap 作为我的框架。
我的首页一直在迷失方向,我的导航栏甚至不正确。我的导航栏一直在我的“英雄单位”上显示。我将此作为一种学习过程来熟悉 MVC 概念。我不确定是什么导致了这种迷失方向。
这是我的首页标记代码的样子:
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html" charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="author" content="">
<title>CodeIgniter Bootstrap</title>
<link href="<?php echo base_url('assets/css/bootstrap.min.css') ?>" rel="stylesheet">
<link href="<?php echo base_url('assets/css/font-awesome.css') ?>" rel="stylesheet">
<link href="<?php echo base_url('assets/css/custom.css') ?>" rel="stylesheet">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.1/lodash.min.js"></script>
<script src="<?php echo base_url('assets/js/bootstrap.min.js') ?>"></script>
<script src="<?php echo base_url('assets/js/custom.js') ?>"></script>
</head>
<body>
<div class="container">
<div class="navbar navbar-fixed-top">
<div class="navbar">
<div class="navbar-inner">
<a class="brand" href="#">Title</a>
<ul …Run Code Online (Sandbox Code Playgroud) 由于我的gen-> com.example.project-> R.java类中的错误,我无法导出我的项目来制作apk.以下是错误所在的代码片段:
public static final class drawable {
public static final int 512=0x7f020000;
public static final int ic_launcher=0x7f020001;
public static final int mr_excuse=0x7f020002;
}
Run Code Online (Sandbox Code Playgroud)
第一行是512,即错误所在的位置.我不知道512来自哪里.我尝试编辑文件并删除整行,但是当我尝试保存它时,我收到一条消息说:
[2014-02-23 10:45:02 - MrExcuse] R.java was modified manually! Reverting to generated version!
Run Code Online (Sandbox Code Playgroud)
我不知道这条消息是为了什么.我只是想删除错误.
我一直在尝试将文件上传到s3存储桶.但该文件永远不会公开查看.我必须手动将存储桶中的文件/文件夹公开(对于每次上传)才能查看.
有没有办法上传具有默认权限的Android文件(位图),以供公开查看.如果可能的话,我更愿意以编程方式执行此操作.我检查了s3文档,找不到任何有用的东西.