
这是我的地图页面,显示了我的应用程序的所有用户.图像(标记)也是从我的服务器提供的URL中获得的.这些标记必须放在Drawable内(如图所示的圆形图像).我使用Canvas从url创建了一个像Bitmap这样的圆圈.
public Drawable showMe(String url)
{
Bitmap bitmap=null;
try {
URL newurl = new URL(url);
bitmap = BitmapFactory.decodeStream(newurl.openConnection().getInputStream());
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
bitmap=getBitmap(url);
Paint paint = new Paint();
paint.setFilterBitmap(true);
int targetWidth = 30;
int targetHeight = 30;
Bitmap targetBitmap = Bitmap.createBitmap(targetWidth, targetHeight,Bitmap.Config.ARGB_8888);
RectF rectf = new RectF(0, 0, 30, 30);
Canvas canvas = new Canvas(targetBitmap);
Path path = new Path();
path.addRoundRect(rectf, …Run Code Online (Sandbox Code Playgroud) 我有一个Iphone应用程序,其中我将两个数组组合并显示在同一个表中.这里的问题是我无法更改单元格中详细textlabel的位置.这是我的代码片段`
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
UIImageView* img = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"cell_with_arrow.png"]];
[cell setBackgroundView:img];
[img release];
}
if(newssarray==nil||[newssarray count]==0)
{
}
else
{
NSDictionary *dicttable=[newssarray objectAtIndex:indexPath.row];
head=[dicttable objectForKey:@"news"];
head1=[dicttable objectForKey:@"name"];
NSString *sub=[dicttable objectForKey:@"created"];
NSLog (@"%@",head);
[[cell viewWithTag:12] removeFromSuperview];
[[cell viewWithTag:13] removeFromSuperview];
[[cell viewWithTag:14] removeFromSuperview];
UIButton *shopLabel=[self buttonWithText:head andFrame:CGRectMake(49, 12, 250,5)] ;
shopLabel.tag=12;
//shopLabel.autoresizingMask=UIViewAutoresizingFlexibleRightMargin;
[shopLabel addTarget:self action:@selector(openRestaurantsList) …Run Code Online (Sandbox Code Playgroud) 我有一个应用程序,我从服务生成很多通知.对于每个通知我有待处理的intent.Also按主页按钮停止我的整个应用程序和服务使用以下代码
System.exit(0);
Run Code Online (Sandbox Code Playgroud)
触发挂起的意图成功,但按下主页按钮后,如果我再次重新启动应用程序它只给出一个黑屏并退出..有趣的是,如果我再次单击应用程序图标,它会重新启动成功..如果活动开始没有使用待定的意图,按下主页按钮并重新启动一切工作正常..
应该是什么原因?任何帮助将不胜感激 ..
我有一个Iphone应用程序,其中我在标签栏中有10个标签项.
我不想在这里添加标签栏的更多按钮行为.
而不是我需要使我的标签栏可滚动.
任何人都有想法或链接来说明这一点吗?
有人能引导我朝正确的方向发展吗?
在我的视图中,我有三个自定义按钮,非矩形图像彼此靠近.然后我有一个问题,每个按钮的可触摸区域与其他按钮重叠.那么如何限制每个按钮的可触摸区域以获得相应的动作呢?
我在我的应用程序中处理相机图像实际上是作为网址.相机应用程序处于纵向模式.因此图像有时会保持旋转或向右旋转.我知道我们可以使用EXIF从图库正常图像方向,我们可以检查exif值并进行适当的更改.这是exif的代码
ExifInterface exif = new ExifInterface("filepath");
exif.getAttribute(ExifInterface.TAG_ORIENTATION);
Run Code Online (Sandbox Code Playgroud)
所以我的问题是在我的情况下什么是文件路径,它是网址本身还是我应该为此创建一个文件..任何帮助将不胜感激....


在日历中,当我选择日期时,我需要更改网格项的背景颜色,并删除以前所选项的背景.当我点击并按住日期10时(如图2所示),它显示橙色.但是当我没有聚焦鼠标时,它没有显示颜色.
gridcell.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v) {
String date_month_year = (String) v.getTag();
selected_date = date_month_year;
String[] day_color = date_month_year.split("-");
String theday = day_color[0];
selectedDateEvents(theday);
listadapter.notifyDataSetChanged();
prev_pos = cur_pos;
cur_pos = position;
Log.d("curr and prev", position+" n "+prev_pos);
parent.getChildAt(cur_pos).setBackgroundResource(R.drawable.calendar_tile_small);
parent.getChildAt(prev_pos).setBackgroundResource(R.drawable.calendar_tile_small_black);
GridCellAdapter.this.notifyDataSetChanged();
}
});
Run Code Online (Sandbox Code Playgroud)
请有人帮帮我吗?
在我的应用程序中,我创建了一个位图并将其保存为SD卡中的JPG图像.我不希望任何其他应用程序使用此图像.这在Android中是否可行?任何帮助将不胜感激 .
我在早上在os X 10.9.5中通过App Store更新通知将我的Xcode更新为6.0.1,然后重新启动了我的mac.
然后我发现Xcode已经更新到6.0.1,但是当我尝试在其上运行我的应用程序时,我只获得iOS设备作为设备,而不是模拟器.
在我的模拟器菜单管理设备没有模拟器只有我的mac存在,然后我试图添加模拟器,但它已经给我错误的路径找不到,我尝试在网络搜索找到的每个解决方案,如位置选项卡命令行工具,一切都好,
但是我仍然没有得到模拟器?有人可以帮助我吗?
我正在尝试安排JobIntentService另一个应用程序(2个不同的进程)的工作.
ComponentName componentName = new ComponentName(context.getPackageName(),
"com.anotherapp.service.MyJobIntentService");
JobIntentService.enqueueWork(this,componentName,100,new Intent());
Run Code Online (Sandbox Code Playgroud)
这给出了以下例外.
java.lang.IllegalArgumentException:uid 10000无法将作业调度到"com.anotherapp.service"
问题是,我们是否能够与JobIntentService我们的应用程序之外进行通信?
注意:在应用程序中,可以安排作业.
android intentservice android-backup-service android-8.1-oreo
android ×5
ios ×4
iphone ×4
ipad ×3
camera ×1
cocoa-touch ×1
exif ×1
google-maps ×1
objective-c ×1
storage ×1
xcode6 ×1