在我的应用程序中有一个图像视图.我将PAN手势添加到该图像视图.
这工作正常.
图像视图处于横向模式.
我希望在用户向右平移时增加标签中的计数,并在用户向左平移时减少该计数.
我google了很多,但没有找到解决方案.
谁能帮助我如何检测用户平移的方向(左/右)?
我在我的应用中实现了推送通知.
它工作正常.
现在问题是,即使我从设备中删除了我的应用程序,它正在获取推送通知.
因此,有什么方法可以在从设备中删除应用程序时从推送通知中取消注册该应用程序.
希望得到你的帮助.
提前致谢.
在iOS 6中,我使用的是这种方法:
[self.handText sizeWithFont:font
minFontSize:10.0f
actualFontSize:&maxFontSize
forWidth:handWidth/2
lineBreakMode:UILineBreakModeClip];
Run Code Online (Sandbox Code Playgroud)
xcode 5说 'sizeWithFont:minFontSIze:actualFontSize:forWidth:lineBreakMode:' is deprecated:first deprecated in iOS 7
现在我实现如下:
[self.handText sizeWithAttributes:@{NSFontAttributeName:font}
minFontSize:10.0f
actualFontSize:&maxFontSize
forWidth:handWidth/2
lineBreakMode:NSLineBreakByClipping];
Run Code Online (Sandbox Code Playgroud)
这里xcode抛出另一个警告说:
'Instance method -sizeWithAttributed:minFontSize:forWidth:lineBreakMode:'not found(return type defaults to 'id')
任何人都可以帮我解决这个警告.
我使用ShareKit在我的应用程序中发布到Twitter和Facebook.Facebook工作正常.
但是,当我试图首先在Twitter上发布消息"已保存"时,然后立即显示警告消息"错误未知错误"并且消息未在Twitter中发布.
任何人都可以帮我这个.
我google了很多,无法弄清楚问题.
希望对你有所帮助.谢谢.
我用了下面的代码:
[SHK setRootViewController:self];
UIImage *im = [UIImage imageNamed:@"newlog.jpg"];
SHKItem *item = [SHKItem image:im title:[NSString stringWithFormat:@"Question: %@ \n \n Answer: %@",t.text,t3]];
item.text=@"The App";
SHKActionSheet *actionSheet1 =[SHKActionSheet actionSheetForItem:item];
[actionSheet1 showInView:self.view];
Run Code Online (Sandbox Code Playgroud)

我是一个相当新的 graphQL。我的要求是发送查询时,graphQL 应返回 JSON 响应,如下所示
{
user: '$',
name: 'Josh',
age: '30'
}
Run Code Online (Sandbox Code Playgroud)
我尝试了以下方法,但没有达到结果。
var express = require('express');
var graphqlHTTP = require('express-graphql');
var { buildSchema } = require('graphql');
var schema = buildSchema(`
type Query {
user: String!
}
`);
// JSON
var json = {
user: '$',
name: 'Josh',
age: '30'
};
var root = {
user: () => {
return json;
}
};
var app = express();
app.use('/graphql', graphqlHTTP({
schema: schema,
rootValue: root,
graphiql: true,
}));
app.listen(4000);
console.log('Running a …Run Code Online (Sandbox Code Playgroud) 我正在开发一个提醒应用程序.
所以我的客户想要设置这个应用程序弹出消息的速率,这将在用户打开应用程序的第10次出现.这可能.
我该如何实现呢?
任何人都可以帮助我.谢谢你提前
我对Android开发很新,刚开始学习.
我正在尝试的是添加一个按钮,当按下该按钮时,文本"我的第一个项目"将显示在文本视图中.
在一些专家的帮助下,我创建了按钮和文本视图.
所以按钮显示在模拟器中,但是当我点击该按钮时没有任何反应.
任何人都可以请帮助我如何在按下按钮时显示文字?
.XML
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/txtView"
android:layout_width="150dp"
android:layout_height="150dp"
android:text="@string/hello" />
<Button
android:id="@+id/mybtn"
android:layout_width="50dp"
android:layout_height="30dp" />
<TextView
android:id="@+id/viewwidth"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/viewheight"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
的.java
import android.app.Activity;
import android.os.Bundle;
import android.widget.Button;
import android.widget.TextView;
import android.view.View;
import android.widget.Toast;
public class NameonbuttonclickActivity extends Activity implements View.OnClickListener {
Button mybtn;
TextView txtView;
String hello;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.main);
super.onCreate(savedInstanceState);
mybtn= new …Run Code Online (Sandbox Code Playgroud) 我只是做了一个示例来检查平移手势。
平移手势正在检测并且工作正常。
但是每当我在平移手势中给出第二个点时,就像CGPoint secondPoint = [sender locationOfTouch:1 inView:self.imageView];它崩溃了一样。
控制台正在给出消息
*** Terminating app due to uncaught exception 'NSRangeException', reason: '-[UIPanGestureRecognizer locationOfTouch:inView:]: index (1) beyond bounds (1).'
Run Code Online (Sandbox Code Playgroud)
当我使用panGestureRecognizer.maximumNumberOfTouches = 1;
panGestureRecognizer.minimumNumberOfTouches =1; 它仍然崩溃。
当我使用panGestureRecognizer.maximumNumberOfTouches = 2;
panGestureRecognizer.minimumNumberOfTouches = 2;
时,它没有进入
- (void)panGestureHandler:(UIPanGestureRecognizer *)sender method.
Run Code Online (Sandbox Code Playgroud)
谁能指导我哪里出错了。
预先感谢您。希望您的帮助。
我用这种方式尝试过。
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
UIPanGestureRecognizer *panGestureRecognizer = [[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(panGestureHandler:)];
panGestureRecognizer.maximumNumberOfTouches = 2;
[self.imageView addGestureRecognizer:panGestureRecognizer];
}
- …Run Code Online (Sandbox Code Playgroud) iphone objective-c uigesturerecognizer ios uipangesturerecognizer
对于您的专家来说,这可能是一个简单的问题,但我无法找出正确的解决方案.
在我的应用程序中,我创建了一个表视图来列出一个项目.
在单元格的第一行有一个switch(ON/OFF).
因此我的客户端需要在切换时隐藏底部单元格(除了第零个单元格)并在切换时OFF显示所有单元格ON.
我通过代码创建了切换.
任何人都可以帮我解决这个问题吗?
提前致谢.
我将本地通知集成到我的应用程序中
它工作正常.
但客户希望使用不同的声音进行本地通知.
我将文件拖放到xcode的支持文件中
谁能帮助我如何做到这一点.
code
AlocalNotifas.soundName = @"cling.wav";
localNotifas.soundName = [[NSBundle mainBundle] pathForResource:@"cling" ofType:@".wav"];
// [localNotifas setSoundName:[[NSBundle mainBundle] pathForResource:@"cling" ofType:@"wav"]];
// [localNotifas setSoundName:UILocalNotificationDefaultSoundName];
Run Code Online (Sandbox Code Playgroud)
你可以请专家告诉我哪里出错了.
大家好我是使用日期选择器,并从标签中的选择器中取出时间.它工作正常.我想要打印从选择器中选择的AM/PM.这是可能的.任何人都可以帮助我...提前谢谢
我使用下面的代码:
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init];
[dateFormatter setDateFormat:@"hh-mm"];
selected = [datePicker date];
NSLog(@"saaa%@",selected);
NSString *dateString = [dateFormatter stringFromDate:selected];
NSString *message = [[NSString alloc] initWithFormat:@"Daily Reminder: %@", dateString];
[dateFormatter release];
label.text=message;
Run Code Online (Sandbox Code Playgroud)