简体   繁体   English

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

[英]How to make the textbox in the Facebook dialogue view bigger, and show App brief?

I can use the Facebook iPhone API to authorize and publish posts, but I want the textbox on the dialogue view bigger, to display more text, instead of only showing 2 lines, as the screenshot: 我可以使用Facebook iPhone API来授权和发布帖子,但是我希望对话框视图上的文本框更大,以显示更多文本,而不是仅显示2行,如屏幕截图所示:


替代文字

Anybody know how to make this textbox bigger? 有人知道如何使此文本框更大吗? Does it have to change the Facebook API code? 是否需要更改Facebook API代码?

If the textbox is supposed to be short as the title of the wall post, how to send the App icon and more text underneath the textbox as shown in the screenshot? 如果应该将文本框作为墙上留言的标题,那么如何如屏幕截图所示在文本框下方发送应用程序图标和更多文本? (I only know how to publish the text in the textbox for the moment) (我目前只知道如何在文本框中发布文本)

Regarding the text under your image, you can check the demo provided with the iOS library. 关于图片下方的文字,您可以查看iOS库随附的演示。 For examle, the part that uploads that text can be found at 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];

}

If you want to add an image at this post as well, try 如果您也想在此帖子中添加图片,请尝试

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

and then you should add this to your attachment NSDictionary: 然后将其添加到附件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];

You can check some guidelines for stream attachements at this link . 您可以在此链接中查看有关流附件的一些准则。 I hope that helps! 希望对您有所帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM