小编Rec*_*dor的帖子

如何更改MFMailComposeViewController文本和按钮图像的颜色?

iOS在MFMailComposeViewController中为所有彩色文本使用标准(蓝色)色调颜色.这对我来说并不好,因为客户希望他的公司颜色在应用程序中.如何将颜色改为橙色?

我特别询问按钮图标(添加图像和铃声图像)的颜色和包含邮件地址的文本.我已经改变了导航栏的颜色.在文档中,有写:

此类的视图层次结构是私有的,您不能修改它.但是,您可以使用UIAppearance协议自定义实例的外观.

我试图使用它,但它不起作用(我可能做错了,因为我不知道UIAppearance).这是我尝试过的:

        [[UIButton appearanceWhenContainedIn:[MFMailComposeViewController class], nil] setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal];

        [[UILabel appearanceWhenContainedIn:[MFMailComposeViewController class], nil] setTextColor:[UIColor orangeColor]];
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

objective-c uiappearance mfmailcomposeviewcontroller

7
推荐指数
1
解决办法
1023
查看次数

在React Native中设置ListView的高度

我需要设置ListView的宽度和高度.当设置宽度按预期工作时,设置高度无效,ListView总是伸展到屏幕的几乎底部(屏幕的bootom和ListView的底部之间只有边距).我用这种方式在render方法中创建ListView:

<ListView ref={component => this._stationsListFrom = component} style={styles.stationsList} dataSource={this.state.dataSource} renderRow={(rowData) => <Text>{rowData}</Text>} />
Run Code Online (Sandbox Code Playgroud)

这是它的风格:

stationsList: {
  backgroundColor: 'white',
  height: 0,
}
Run Code Online (Sandbox Code Playgroud)

我还尝试通过此命令在方法中设置其高度:

this._stationsListFrom.setNativeProps({height: 200});
Run Code Online (Sandbox Code Playgroud)

当我尝试使用此命令设置宽度时,它可以工作.但设定高度什么都不做.

如何将ListView的高度(例如,在TextInput的情况下,它不是一个问题)设置为所需的值?我唯一的方法是使用底部边距,但这不是我想要使用的方式.

我只在iOS上测试(因为它在Android上的工作方式不同).

我的代码:

import React, { Component } from 'react';
import Dimensions from 'Dimensions';
import {
  AppRegistry,
  StyleSheet,
  Text,
  TextInput,
  ListView,
  Button,
  View
} from 'react-native';

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'flex-start',
    alignItems: 'flex-start',
    backgroundColor: '#D8CD36',
    padding: 25
  },
  label: {
    textAlign: 'left',
    color: '#333333',
    fontSize: 20,
    margin: 5,
  }, 
  textInput: …
Run Code Online (Sandbox Code Playgroud)

listview ios react-native

6
推荐指数
1
解决办法
7080
查看次数

无法使用Facebook iOS SDK

我试图在Objective C应用程序中实现.如果我没有登录Facebook,则在点击"赞"按钮后,应用程序会打开登录屏幕.我会登录我的帐户.然后屏幕变成浅灰色带有Facebook的灰色标志一段时间(之前有2个很快显示灰色的Facebook屏幕),然后我被重定向回我的应用程序.如果我在运行应用程序时登录Facebook,除了没有显示登录屏幕外,一切都是相同的.

所以我的问题是,我没有得到正确的确认对话框,该对话框应该在登录FB帐户后出现,我被重定向回我的应用程序.喜欢不放.

导致这种行为的原因是什么?

我已将所有需要的3行放入.plist中,这就是我创建的按钮(p_webView是我的UIWebView的子类):

if (p_webView.fbLikeButton == nil) {
    p_webView.fbLikeButton = [[FBSDKLikeControl alloc] init];
}
p_webView.fbLikeButton.objectID = p_webView.article.url;
[p_webView.fbLikeButton setFrame:CGRectMake(p_webView.fbLikeButton.frame.origin.x, height + 5, p_webView.fbLikeButton.frame.size.width, p_webView.fbLikeButton.frame.size.height)];
[p_webView.fbLikeButton setCenter:CGPointMake(p_webView.frame.size.width / 2, p_webView.fbLikeButton.center.y)];
[p_webView.scrollView addSubview:p_webView.fbLikeButton];
Run Code Online (Sandbox Code Playgroud)

更多信息 - 我在模拟器上试过这个(我没有FB应用程序,所以它只使用Safari).登录后,我有错误:

"您请求的页面目前无法显示.它可能暂时不可用,您点击的链接可能已损坏或已过期,或者您可能无权查看此页面."

由于可能很难找到解决方案 - 需要在FB应用程序中作为管理员,开发人员或测试人员,以便在测试未经Apple批准使用本机按钮的应用程序时使用类似按钮.

facebook objective-c facebook-like ios

0
推荐指数
1
解决办法
1166
查看次数