簡體   English   中英

使用UIImageView更改FBProfilePictureView(或加載UIImage)Swift

[英]Change FBProfilePictureView with an UIImageView(or load an UIImage) Swift

好吧,我有這個問題! 我正在嘗試制作一個應用,使其在首次加載時使用FB個人資料圖片。

但是他們可以稍后更改圖像。

現在,我一直試圖一直使用FBProfilePictureView視圖。

並嘗試將其轉換為Swift。 它沒有按計划進行。

 let imageURL = NSURL(string: img.valueForKey("url") as String)
        Alamofire.request(.GET, imageURL!).response() {
            (_, _, data, _) in

            let image = UIImage(data: data! as NSData)
            for obj in self.fb_background.subviews{

                if(obj.isKindOfClass(UIImageView)){

                    obj.image = image
                }
            }

這是行不通的,obj不能重新定義為UIImageView

我如何使它工作?

如果要顯示Facebook頭像,只需向FBProfilePictureVIew提供一個profileID字符串。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM