繁体   English   中英

钛加载Facebook个人资料图片集成无效

[英]Titanium load Facebook profile picture integration doesn't work

我正在寻找一种在Titanium应用程序中集成Facebook个人资料图片的方法。 我正在谷歌搜索,然后尝试了这个:

var imageAvatar = Ti.UI.createImageView({
            image: "http://graph.facebook.com/"+FacebookUID+"/picture",
            left:10, top:5,
            width:50, height:50
          });

但这不起作用,它不会向我显示人员UID的个人资料照片。

有谁能够帮助我 ? 非常感谢你!

编辑#1:我也尝试过HTML,它工作正常! 而且UID不是空的,所以这不是问题。

编辑#2(更多代码):

var tableData = [];

    for(var i=1; i < json.length; i++) {
        alert(i+' - GAME #'+json[i].GameId);
        var row = Ti.UI.createTableViewRow({
            className:'forumEvent', // used to improve table performance
            rowIndex:i, // custom property, useful for determining the row during events
            height:110
          });
        var imageAvatar = Ti.UI.createImageView({
            image: "http://graph.facebook.com/"+Ti.App.fb.uid+"/picture",
            left:10, top:5,
            width:50, height:50
          });
          row.add(imageAvatar);
          var labelUserName = Ti.UI.createLabel({
            color:'#576996',
            font:{fontFamily:'Arial', fontSize:defaultFontSize+6, fontWeight:'bold'},
            text:'Fred Smith ' + i,
            left:70, top: 6,
            width:200, height: 30
          });
          row.add(labelUserName);
        var labelDetails = Ti.UI.createLabel({
            color:'#222',
            font:{fontFamily:'Impact', fontSize:defaultFontSize+2, fontWeight:'normal'},
            text:'Replied to post with id 1234.',
            left:70, top:44,
            width:360
          });
          row.add(labelDetails);
          tableData.push(row);
    }

    Ti.App.multi_tableView.data = tableData;

//另一个文件

Ti.App.multi_tableView = Ti.UI.createTableView({
top: 60,
bottom: 80
});

我认为您应该参考以下链接以获取更多详细信息。

并且通过此链接,您需要在主机api网址之后添加版本号。

https://graph.facebook.com/v2.4/ {user-id} / picture

https://developers.facebook.com/docs/graph-api/reference/user/picture

这对我有用。

暂无
暂无

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

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