我在mapView上有两个UISegmentedControls.

你可以看到第二个控件右侧的白色背景,我无法删除.欢迎任何帮助.
在Android应用程序中,我使用JSON来获取MySQL对象.在活动中,我在列表中显示对象.选择其中一个对象后,应该打开一个新活动,但是有一个我无法找到的错误.
这是应该打开第二个活动的第一个活动的代码的一部分:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_categorias);
contactList = new ArrayList<HashMap<String, String>>();
ListView lv = getListView();
// Listview on item click listener
lv.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
// getting values from selected ListItem
String name = ((TextView) view.findViewById(R.id.name))
.getText().toString();
String cost = ((TextView) view.findViewById(R.id.email))
.getText().toString();
//Starting single contact activity
Intent in = new Intent(getApplicationContext(),
ofertas_list.class);
in.putExtra(TAG_NAME, name);
in.putExtra(TAG_ID, cost);
startActivity(in);
}
});
// Calling async task to get …Run Code Online (Sandbox Code Playgroud) 我正在使用 Eclipse 和 Android SDK 工具版本 22.6.2 创建一个 Android 应用程序。
我不明白如何处理片段。我已经删除了默认的片段布局,现在我正在使用普通布局文件创建应用程序。在 Eclipse 上还有一个名为 appcompat_v7 的默认文件夹,这对我来说是新的。
MainActivity 现在是 ActionBarActivity 类型的默认值:
public class MainActivity extends ActionBarActivity {
Run Code Online (Sandbox Code Playgroud)
在包含以下行后,我已将其更改为 Activity 类型:
import android.app.Activity;
Run Code Online (Sandbox Code Playgroud)
然后我将类型更改为:
public class MainActivity extends Activity {
Run Code Online (Sandbox Code Playgroud)
到目前为止一切正常。
现在,我不知道保留文件夹 appcompat_v7 的原因是什么。如果我删除或重命名它,我的应用程序上会出现很多错误。
恳请您告知我此文件夹的功能。
我正在检索我的Android应用程序的JSON对象.他们有两个领域:date和time.在布局上,我需要从这两个字段中提取以下字符串:
- 星期几(例如星期一)
- 每月的某一天(例如21)
- 月份(例如四月)
- 年份(例如2014年)
- 小时(例如17)
- 分钟(例如35)
这些领域是date="2014-04-21",time="17:35:00"
我怎么能这样做?
我正在学习开发iOS应用程序的教程.我正在使用核心数据.该应用程序的第一个视图是RootViewController.所有Core Data堆栈都在AppDelegate文件中.这是代码的一部分AppDelegate.m,它调用RootViewController文件:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Fetch the data to see if we ought to pre-populate
NSError *error = nil;
if (![[self fetchedResultsController] performFetch:&error]) {
NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
abort();
}
[self loadFavoriteThingsData];
RootViewController *rootViewController = (RootViewController *)[navigationController topViewController];
[rootViewController setManagedObjectContext:[self managedObjectContext]];
[window addSubview:[navigationController view]];
[window makeKeyAndVisible];
return YES;
}
Run Code Online (Sandbox Code Playgroud)
现在,在应用程序的另一部分,我需要打开一个新的视图控制器,它是一个副本RootViewController,被称为DoneViewController,但使用其他NSPredicates来显示其他核心数据对象.
在RootViewController那里有一个打开MenuViewController文件的按钮,从那里我尝试DoneViewController使用以下方法打开:
- (IBAction)doneToDoaction:(id)sender …Run Code Online (Sandbox Code Playgroud) 我在viewDidLoad方法中有一个NSTimer:
timer = [NSTimer scheduledTimerWithTimeInterval: 10.0
target: self
selector: @selector(refrescar_vehiculo_asignado:)
userInfo: nil
repeats: YES];
Run Code Online (Sandbox Code Playgroud)
启动的选择器是这样的:
-(void) refrescar_vehiculo_asignado {
NSURL *apiURL = [NSURL URLWithString:
[NSString stringWithFormat:@"http://..hidden here../?employee=%@", _employee]];
NSURLRequest *request = [NSURLRequest requestWithURL:apiURL]; // this is using GET, for POST examples see the other answers here on this page
[NSURLConnection sendAsynchronousRequest:request
queue:[NSOperationQueue mainQueue]
completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
if(data.length) {
NSString *responseString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
if(responseString && responseString.length) {
NSLog(@"dATOS RECIBIDOS=%@", responseString);
NSError *jsonError;
NSData *objectData = …Run Code Online (Sandbox Code Playgroud) 我正在尝试从 Ajax 函数打开 URL,但未调用该 URL。
这是我的代码:
$(document).on( "click",".btndriver", function() {
var id = $(this).attr("id");
var nombre = $(this).attr("nombre");
swal({
title: "Select Driver?",
text: "Select Driver? : "+nombre+" ?",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "GO",
closeOnConfirm: true },
function(){
var value = {
id: id
};
$.ajax(
{
url : "ondemand_driver.php",
type: "POST",
data : value,
success: function() {
window.location(url);
}
});
});
});
Run Code Online (Sandbox Code Playgroud)
有什么问题吗?
我正在研究一个PHP文件.
我通过POST收到一个字符串数组:
$str = (45,42,12,);
Run Code Online (Sandbox Code Playgroud)
首先我删除最后一个逗号:
$str = substr($string_temas,0,-1);
Run Code Online (Sandbox Code Playgroud)
我明白了
$str = (45,42,12);
Run Code Online (Sandbox Code Playgroud)
为了检查它,我回应了它:
echo "str value=".$str;
Run Code Online (Sandbox Code Playgroud)
我得到回声结果:
str值= 45,42,12
然后我尝试循环每个项目,如下所示:
foreach ($str as $value) {
}
Run Code Online (Sandbox Code Playgroud)
但我收到一个错误:
在.....行中为foreach()提供的参数无效 (foreach ($str as $value) {
我究竟做错了什么?
我正在尝试在屏幕上创建一个包含从远程服务器加载的项目的列表。
\n Container(\n child: FutureBuilder(\n future: fetchClinicas(),\n builder: (context, snapshot) {\n if (snapshot.hasData) {\n return ListView.builder(\n itemCount: snapshot.data.length,\n shrinkWrap: true,\n itemBuilder: (BuildContext contex, index) {\n Clinica clinica = snapshot.data[index];\n return Text(\n '${clinica.nombreClinica}',\n style: TextStyle(fontSize: 20),\n );\n },\n );\n }\n return CircularProgressIndicator();\n },\n ),\n ),\nRun Code Online (Sandbox Code Playgroud)\n这里有两个文件:
\n临床API.dart
\nFuture<List<Clinica>> fetchClinicas() async {\n String url ="https://.../get_clinicas.php";\n final response = await http.get(url);\n return clinicaFromJson(response.body);\n\n}\nRun Code Online (Sandbox Code Playgroud)\n和模型类Clinica.dart
\nimport 'dart:convert';\n\nList<Clinica> clinicaFromJson(String str) => List<Clinica>.from(json.decode(str).map((x) => Clinica.fromJson(x)));\n\nString clinicaToJson(List<Clinica> data) => json.encode(List<dynamic>.from(data.map((x) => …Run Code Online (Sandbox Code Playgroud) 我正在使用 pdf 包在 Flutter 中创建我的第一个 PDF 文档。
这里有我需要更改的 pdf 部分的部分屏幕截图:
您可能会看到 6 行,每行都有一个时间和一个字符串。
这里有该屏幕截图的代码:
static Widget buildTablaDiario(List<dynamic> listaDiarioActual){
return ListView.builder(
itemCount: listaDiarioActual.length,
itemBuilder: (pw.Context context, index){
DiarioModelo diario = listaDiarioActual[index];
DateTime tempDateI =
new DateFormat("yyyy-MM-dd hh:mm:ss")
.parse(diario.fecha_diario);
String date1 = DateFormat("dd-MM-yyyy HH:mm")
.format(tempDateI);
String hora = DateFormat("HH:mm")
.format(tempDateI);
return Row(
children: [
pw.Text("${hora}"),
pw.SizedBox(width: 10),
pw.Text(diario.descripcion,overflow: TextOverflow.clip)
]
);
}
);
}
Run Code Online (Sandbox Code Playgroud)
我想设置一个右边距,以避免文本行在文档的右边缘结束。