小编Rub*_*uck的帖子

使用WAMP调用未定义的函数curl_init()

我正努力让cUrl工作,我很难过.

extension=php_curl.dllphp.ini文件中取消注释并检查php_curl.dll存在于extension_dir指向的目录中.我还检查php.ini过Apache目录中是否正确.

我已将libcurl.dll's 复制到Windows/System32,Windows/SysWOW64和wamp\bin\php\php5.4.3

我每次都重新启动服务.

我仍然得到了Fatal error: Call to undefined function curl_init().当我跑步时,卷曲不会出现phpInfo().但是当我查看WAMP菜单PHP-> PHP扩展php_curl确实有一个复选标记.

任何提示?

编辑:

@Daniel_M:加载的ini是Apache目录中的一个,并且extension=php_curl.dll已经取消注释,并extension_dir指向(和)php/php5.4.3/ext所在的目录.php_curl.dlllibcurl.dll

@ficuscr:我已经复制libcurl.dll v.7.27.0了整个地方.我应该把它放在哪里?

一般情况下:当php_curl取消选中时PHP > PHP Extensions menu,致命错误的前提是: SCREAM: Error suppression ignored for.php_curl检查时不会发生这种情况.在任何一种情况下,致命错误消息都是相同的.线索?

php wamp

29
推荐指数
3
解决办法
6万
查看次数

在UIPageViewController上将TranslatesAutoresizingMaskIntoConstraints设置为No

我正在构建一个复杂的项目,除其他外,我需要将UIPageViewController设置为主视图的子视图.我正在使用autolayout,并使用约束来命令主视图上的各种元素.

问题是,当我尝试运行应用程序时,由于NSAutoresizingMaskLayoutConstraints冲突而崩溃.

2013-10-28 16:22:18.419 Red Event App[1658:60b] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) 
(
"<NSLayoutConstraint:0x145c1990 V:|-(20)-[UINavigationBar:0x145bf6b0]   (Names: …
Run Code Online (Sandbox Code Playgroud)

objective-c ios uipageviewcontroller

12
推荐指数
2
解决办法
1万
查看次数

UIImagePickerController强制其他视图中的图像为完整大小

在我的应用程序的一个位置,我需要使用相机,所以我打电话给UIImagePickerController.不幸的是,一旦我从控制器返回,应用程序中的大多数图片都是全尺寸的,无论它们的UIImageView属性如何.例外似乎是UIImageViews中的UITableViewCells.这适用于应用程序中的所有视图,而不仅仅是与调用它的viewcontroller直接连接的视图UIImagePickerController.有一次,当我在弄乱,试图排除故障时,问题似乎自己消失了,虽然我无法复制它.

代码如下.

-(void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];

    if(![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]){
        UIAlertView *errorAlertView = [[UIAlertView alloc] initWithTitle:@"Error"
                                                           message:@"Device has no camera"
                                                           delegate:nil
                                                           cancelButtonTitle:@"OK"
                                                           otherButtonTitles:nil];
        [errorAlertView show];
        [_app.navController popPage];
    }
    else if(firstTime){
        UIImagePickerController *picker = [[UIImagePickerController  alloc] init];
        picker.delegate = self;
        picker.allowsEditing = YES;
        picker.sourceType = UIImagePickerControllerSourceTypeCamera;

        firstTime = false;

        [self presentViewController:picker animated:YES completion:NULL];
    }
}

-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
    UIImage *cameraImage = info[UIImagePickerControllerEditedImage];
    [picker dismissViewControllerAnimated:YES completion:NULL];

    NSString *folderName = @"redApp";
    if([_page hasChild:[RWPAGE …
Run Code Online (Sandbox Code Playgroud)

objective-c uiimagepickercontroller ios

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

使用XCTest测试自动布局

我想弄清楚在使用autolayout时是否有办法在单元测试中测试iOS视图的布局.现在我尝试简单地初始化视图控制器,然后检查视图的帧.但是,每个视图上的帧仍然是origin =(x = 0,y = 0)size =(width = 0,height = 0).

- (void)setUp {
    [super setUp];

    _viewController = [[AddPlayerViewController alloc] init];
    _viewController.view.frame = CGRectMake(0, 0, 320, 460);
    [_viewController view];
}

- (void)testViewsAreInsideWindow {
    [self checkIfViewIsInsideWindow:_viewController.txtfNewPlayer];
    [self checkIfViewIsInsideWindow:_viewController.btnNewPlayer];
    [self checkIfViewIsInsideWindow:_viewController.tblPlayers];
}

- (void)checkIfViewIsInsideWindow:(UIView *)view {
    CGRect windowFrame = _viewController.view.frame;
    CGRect viewFrame = view.frame;
    XCTAssertTrue(CGRectContainsRect(windowFrame, viewFrame));
}
Run Code Online (Sandbox Code Playgroud)

我试过添加

[_viewController.view needsUpdateConstraints];
Run Code Online (Sandbox Code Playgroud)

要么

[_viewController.view updateConstraints];
Run Code Online (Sandbox Code Playgroud)

要么

[_viewController updateViewConstraints];
Run Code Online (Sandbox Code Playgroud)

要么

[_viewController viewWillAppear:YES];
Run Code Online (Sandbox Code Playgroud)

但他们都没有帮助.

使用XCTest时是否可以使autolayout运行?

objective-c ios autolayout xctest

5
推荐指数
1
解决办法
2367
查看次数

如何将 TextView 限制为整行

我在 ListView 中有一个具有以下布局的单元格。

\n\n

单元布局

\n\n

问题是 TextView 中的最后一行带有黑色文本。我想在该 TextView 中只包含完整的行(因此在本例中为两行),最好使用椭圆形来显示文本已被截断。

\n\n

在这个特定的实例中,我可以只设置 maxLines="2",但有时粉红色标题可能只是一行,所以在这些情况下,我希望正文具有完整的三行,以便有空间。

\n\n

编辑:显示 XML

\n\n
<?xml version="1.0" encoding="utf-8"?>\n<FrameLayout\n    xmlns:android="http://schemas.android.com/apk/res/android"\n    xmlns:app="http://schemas.android.com/apk/res-auto"\n    xmlns:tools="http://schemas.android.com/tools"\n    android:layout_width="match_parent"\n    android:layout_height="110dp">\n\n    <RelativeLayout\n        android:orientation="horizontal"\n        android:layout_width="match_parent"\n        android:layout_height="match_parent"\n        android:layout_marginLeft="10dp"\n        android:layout_marginRight="10dp"\n        android:layout_marginTop="5dp"\n        android:layout_marginBottom="5dp"\n        android:background="@drawable/card_background">\n\n        <ImageView\n            android:id="@+id/imgNews"\n            android:layout_marginLeft="16dp"\n            android:layout_centerVertical="true"\n            android:layout_width="65dp"\n            android:layout_height="65dp"\n            android:scaleType="centerCrop"\n            tools:src="@drawable/news1" />\n\n        <LinearLayout\n            android:orientation="vertical"\n            android:layout_width="match_parent"\n            android:layout_height="wrap_content"\n            android:layout_toRightOf="@+id/imgNews"\n            android:layout_centerVertical="true"\n            android:layout_marginTop="8dp"\n            android:layout_marginLeft="16dp"\n            android:layout_marginRight="16dp"\n            android:layout_marginBottom="8dp">    \n\n            <TextView\n                android:id="@+id/lblNewsDate"\n                android:layout_height="wrap_content"\n                android:layout_width="match_parent"\n                android:textSize="12sp"\n                android:textColor="#b3b3b3b3"\n                android:maxLines="1"\n                tools:text="29. oktober 2015" />\n\n            <TextView\n                android:id="@+id/lblNewsTitle"\n                android:layout_height="wrap_content"\n                android:layout_width="match_parent"\n                android:textSize="14sp"\n                android:textColor="#df0784"\n                android:textAllCaps="true"\n                android:maxLines="2"\n                android:ellipsize="end"\n                tools:text="Festivalen modtager donationer fra fionia fond"/>\n\n …
Run Code Online (Sandbox Code Playgroud)

layout android android-layout

5
推荐指数
1
解决办法
2730
查看次数