React Native Toolbar未显示

时间:2017-06-12 09:23:22

标签: react-native

我只是React Native beginner。我刚刚创建了NavigatorDrawer类,Home.js和Team.js.I刚刚添加了工具栏,但它没有显示。任何人都可以查看我的代码并帮助我在哪里犯了错误。

Home.js

func webServiceImageUploadForMyProfile(image:UIImage,url:String,method:HTTPMethod,parameters : [String:AnyObject]?,completionHandler:@escaping (JSON?,String)->Void) {

    let url = try! URLRequest(url: url, method: .post, headers: nil)
    Alamofire.upload(multipartFormData:{ multipartFormData in
        if  let imageData = UIImageJPEGRepresentation(image, 0.6) {
            multipartFormData.append(imageData, withName: "image", fileName: "Profile.png", mimeType: "image/png")
        }
        for (key, value) in parameters! {
            multipartFormData.append(value.data(using: String.Encoding.utf8.rawValue)!, withName: key)
        }
        }, with: url, encodingCompletion: {
            encodingResult in
            switch encodingResult {
            case .success(let upload, , ):
                upload.uploadProgress(closure: { (progress) in
                    print("Upload Progress: \(progress.fractionCompleted)")
                })
                upload.responseJSON { response in
                    if(response.result.isSuccess){
                        if let data = response.result.value{
                            let json = JSON(data)
                            print(json)
                            completionHandler(json,String())
                            return
                        }
                    }else {
                        completionHandler(nil,(response.result.error?.localizedDescription)!)
                    }
                    }

            case .failure( _):

                break
            }
    })
}

index.android.js:

const { navigate } = props.navigation;
return (
    <ToolbarAndroid
     title='Home'
     style={styles.toolbar}
     titleColor='white'
    />
    <View>
    <Text style={styles.abt}Home</Text>
    </View>
      );

0 个答案:

没有答案