如何使Facebook对话视图中的文本框更大,并显示App简介?

时间:2010-09-28 09:37:51

标签: objective-c facebook

我可以使用Facebook iPhone API授权和发布帖子,但我希望对话视图上的文本框更大,以显示更多文字,而不是仅显示2行,如截图所示:


alt text

有人知道如何让这个文本框变大吗?是否必须更改Facebook API代码?

如果文本框应该简短为墙贴的标题,如何在文本框下面发送应用程序图标和更多文本,如屏幕截图所示? (我现在只知道如何在文本框中发布文本)

1 个答案:

答案 0 :(得分:1)

关于图片下的文字,您可以查看iOS库提供的演示。例如,可以在this file找到上传该文本的部分:

- (IBAction) publishStream: (id)sender {

  SBJSON *jsonWriter = [[SBJSON new] autorelease];

  NSDictionary* actionLinks = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys:
                               @"Always Running",@"text",@"http://itsti.me/",@"href", nil], nil];

  NSString *actionLinksStr = [jsonWriter stringWithObject:actionLinks];
  NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys:
                               @"a long run", @"name",
                               @"The Facebook Running app", @"caption",
                               @"it is fun", @"description",
                               @"http://itsti.me/", @"href", nil];
  NSString *attachmentStr = [jsonWriter stringWithObject:attachment];
  NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                 kAppId, @"api_key",
                                 @"Share on Facebook", @"user_message_prompt",
                                 actionLinksStr, @"action_links",
                                 attachmentStr, @"attachment",
                                 nil];


  [_facebook dialog: @"stream.publish"
          andParams: params
        andDelegate:self];

}

如果您想在此帖子中添加图片,请尝试

NSDictionary* media = [NSDictionary dictionaryWithObjectsAndKeys:
                           @"image", @"type",
                           @"your.image/url.png", @"src",
                           @"http://www.alink.org", @"href",
                           nil];

然后你应该把它添加到你的附件NSDictionary:

NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys:
                                   @"a long run", @"name",
                                   @"The Facebook Running app", @"caption",
                                   @"it is fun", @"description",
                                   [NSArray arrayWithObjects:media, nil ], @"media",
                                   @"http://itsti.me/", @"href", nil];

您可以在this link查看流附件的一些准则。 我希望有所帮助!