小编vin*_*thp的帖子

如何以编程方式在二维数组中插入值?

我想在java中动态地执行此操作.我知道如何在单维数组中插入值.我在二维数组中有点困惑.

static final String shades[][] = {


 // Shades of grey
  {
    "lightgrey", 
    "dimgray", 
    "sgi gray 92", 
  },
 // Shades of blue
  {
    "dodgerblue 2", 
    "steelblue 2", 
    "powderblue", 
  },
// Shades of yellow
  {
    "yellow 1",
    "gold 1",
    "darkgoldenrod 1", 
  },
 // Shades of red
  {
    "indianred 1", 
    "firebrick 1", 
    "maroon", 
  }
};
Run Code Online (Sandbox Code Playgroud)

java arrays android arraylist multidimensional-array

8
推荐指数
2
解决办法
14万
查看次数

如何在iOS中设置闹钟?

我知道这个问题已经在StackOverflow上多次询问但我无法在我的应用程序中设置闹钟,因为我对iOS很新?我正在按照本教程设置警报:

在iOS中使用UILocalNotification设置提醒.

但是,它似乎对我不起作用.

我每天都需要设置闹钟让我们5.00 PM每天说.我不能使用日期选择器来选择时间.

alarm ios uilocalnotification

6
推荐指数
1
解决办法
2万
查看次数

新行(\n)不支持android?

我试图在Android中使用\n将单个字符串拆分为两行,但它也显示为\n.我期待下面,

String new = "Hi, How are you";
Run Code Online (Sandbox Code Playgroud)

在EditText框中,我需要,

Hi,

How are you

我知道它的简单问题,但我找不到解决方案.

java android android-widget android-edittext android-view

4
推荐指数
2
解决办法
2万
查看次数

System.IO.File'在Unity3D中不包含"AppendAllText"错误的定义?

我是Unity3d的新手,并试图打开一个现有的项目.播放时显示以下错误.

Assets/Scripts/DataAccess.cs(39,30):错误CS0117:System.IO.File' does not contain a definition forAppendAllText'

我对如何解决这个问题一无所知.我被困在这里.

如果有人解决这个问题,那将是一种欣赏.

提前致谢...

c# monodevelop unity-game-engine xamarin.android

4
推荐指数
1
解决办法
7272
查看次数

SMS BroadCast接收器多次收到?

我在我的应用程序中使用短信广播接收器.当我发送第一个短信时,它会弹出一条短信作为短信发送.当我发送第二个请求时,弹出消息加倍.它第三次增加了三倍,等等.我使用以下代码发送和接收广播.

  private void sendRequest()
    {        
        String SENT = "SMS_SENT";
        String DELIVERED = "SMS_DELIVERED";

        PendingIntent sentPI = PendingIntent.getBroadcast(this, 0,
            new Intent(SENT), 0);

        PendingIntent deliveredPI = PendingIntent.getBroadcast(this, 0,
            new Intent(DELIVERED), 0);

        //---when the SMS has been sent---
        registerReceiver(new BroadcastReceiver(){
            @Override
            public void onReceive(Context arg0, Intent arg1) {
                switch (getResultCode())
                {
                    case Activity.RESULT_OK:
                        Toast.makeText(getBaseContext(), "SMS sent", 
                                Toast.LENGTH_SHORT).show(); 
                        break;
                    case SmsManager.RESULT_ERROR_GENERIC_FAILURE:
                        Toast.makeText(getBaseContext(), "Invalid PhoneNumber", 
                                Toast.LENGTH_SHORT).show();
                        break;
                    case SmsManager.RESULT_ERROR_NO_SERVICE:
                        Toast.makeText(getBaseContext(), "No service", 
                                Toast.LENGTH_SHORT).show();
                        break;
                    case SmsManager.RESULT_ERROR_NULL_PDU:
                        Toast.makeText(getBaseContext(), "Null PDU", 
                                Toast.LENGTH_SHORT).show();
                        break;
                    case SmsManager.RESULT_ERROR_RADIO_OFF:
                        Toast.makeText(getBaseContext(), "Radio …
Run Code Online (Sandbox Code Playgroud)

sms android broadcastreceiver

4
推荐指数
1
解决办法
2343
查看次数

如何在iOS中的ViewController中添加View以下的其他视图?

在我的应用程序中,我正在创建混合的视图控制器,UILabelUITextview希望可滚动,因为文本是动态的,也超过垂直屏幕大小.

我目前正在使用Scrollview,其子视图如下.视图在Xcode 4.3 Storyboard中创建.

UILabel1(Say Heading)

UITextView1(可以是任意大小的动态文本)

UILabel2(第二标题)

UITextView2(可以是任意大小的动态文本)

等等.

问题是

UITextView1有更多内容然后它与UILabel2我不想要的重叠.

我想UILabel1在scrollView之上和UITextView1之下UILabel1.UILabel2下面UITextView1 等等.

我必须做些什么才能实现这一目标?

编辑

在故事板中

![在此处输入图像说明] [1]

在模拟器中

![在此输入图像说明] [2]

谢谢你的帮助.非常感激.

- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.

[scrollView setScrollEnabled:YES];     
[self.view addSubview:cockTailNameLabel];
[self.view insertSubview:txtIngredients belowSubview:cockTailNameLabel];
[self.view insertSubview:scrollView belowSubview:cockTailNameLabel];
//[scrollView]

[self.cockTailNameLabel setText:self.passcockTailName];  

[_txtUse setText:self.passUse]; 
[_txtUse setEditable:NO];
[_txtUse setUserInteractionEnabled:NO];

CGRect useFrame = _txtUse.frame; …
Run Code Online (Sandbox Code Playgroud)

iphone uiscrollview ios ios5

4
推荐指数
1
解决办法
1万
查看次数

如何在ios中加粗按钮文字?

在我的应用程序中,我使用自定义字体,工作得很好.但我需要按钮文字为粗体.我用谷歌搜索它只有系统字体.

button.titleLabel.font = [UIFont fontWithName:@"YanaR" size:20.0]; 
Run Code Online (Sandbox Code Playgroud)

谢谢你的帮助.

iphone fonts ios ios5

4
推荐指数
1
解决办法
8306
查看次数

如何将数据从一个视图传回到IOS中的其他视图?

我可以毫无问题地将数据从一个视图传递到其他视图.但这是我面临问题的情况.

让我们说 - >将数据传递给其他视图

ViewA->ViewB This working perfectly fine 
ViewB->ViewC This working perfectly fine
ViewC->ViewB Here is the problem.
Run Code Online (Sandbox Code Playgroud)

我尝试使用push segue,它转到ViewB但是当我按下后退按钮时它转到ViewC->后退按钮 - > ViewB->后退按钮 - >视图A.当我按下后退按钮时,它必须转到ViewA.

尝试使用模态segue,它去ViewB但然后我不能去任何地方.

由于我是iOs的新手,我真的不知道如何实现这个目标?

如何从ViewC将数据传回ViewB?

我想你们可以帮助我.

编辑

在View A中,我正在调用ViewB

-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if([segue.identifier isEqualToString:@"RemixScreen"])
{

    if([self.recipeFrom isEqualToString:@"ViewB"])
    {

        ViewB *reciepe = [segue destinationViewController];
        //somedata i will pass here

    }  
}
 }
Run Code Online (Sandbox Code Playgroud)

在View B中,我这样打电话

-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
  {
if([segue.identifier isEqualToString:@"ViewA"])
{  
    ViewA *data = [segue destinationViewController];
    //some data  
} …
Run Code Online (Sandbox Code Playgroud)

iphone uiviewcontroller modalviewcontroller ios ios5

4
推荐指数
1
解决办法
9845
查看次数

如何从iOS中的警报通知操作启动视图控制器?

在我的应用程序中我正在使用闹钟功能.它工作正常.当我点击右键时,它会启动我的应用程序.但我想启动View Controller,它不是rootViewController.我尝试在Google和SO搜索,但我无法得到任何想法或例子.

我正在寻找任何一个例子来实现这一目标.

谢谢你的帮助.

编辑

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{     
// Add the view controller's view to the window and display.
[self.window addSubview:alarmViewController.view];
[self.window makeKeyAndVisible];

application.applicationIconBadgeNumber = 0;


// Handle launching from a notification
UILocalNotification *localNotif =
[launchOptions objectForKey:UIApplicationLaunchOptionsLocalNotificationKey];
if (localNotif) {
    NSLog(@"Recieved Notification %@",localNotif);

    window = [[UIApplication sharedApplication] keyWindow];
    UIViewController *rootViewController = [window rootViewController];
    [rootViewController presentModalViewController:receipeViewController animated:YES];         
}


// Override point for customization after application launch.
return YES;
Run Code Online (Sandbox Code Playgroud)

}

- (void)application:(UIApplication *)app didReceiveLocalNotification:(UILocalNotification *)notif {
// Handle the …
Run Code Online (Sandbox Code Playgroud)

iphone alarm ios uilocalnotification

4
推荐指数
1
解决办法
5292
查看次数

在PHP中将十六进制转换为图像?

我正在开发与服务器通过的移动应用程序PHP Webservice.这是我第一次使用PHP.我设法将数据上传到数据库.现在我需要发送一个图像来存储在ftp服务器中.为此我转换image->hex并从我的应用程序发送.

服务器端

我得到了十六进制代码,但不知道如何将其转换为图像并存储在ftp服务器中.我真的在这里挣扎.我用Google搜索但找不到确切的一个.

任何帮助深表感谢.

php mysql web-services

4
推荐指数
1
解决办法
8089
查看次数