经过几个小时的斗争,从Eclipse导入的旧项目使用Gradle并进入Android Studio v0.1.3 ...我现在所能实现的是我可以在命令行上实际构建,但是当我做Build时/ 在 Studio中重建项目我得到:
Gradle:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':EpicMix'.
> Failed to notify project evaluation listener.
> A problem occurred configuring project ':facebook'.
> Failed to notify project evaluation listener.
> java.lang.OutOfMemoryError: PermGen space
Run Code Online (Sandbox Code Playgroud)
这不是一个巨大的项目,有一些小的子项目(包括Facebook),所以我不认为它真的是内存.我只是想不通这是什么......
我正在创建两个应用程序,我们称之为Foo Bar和Foo Bar Pro.当我安装它们并打开iTunes时,我在那里看到了两个应用程序,但它们都说Foo Bar,因为"Foo Bar Pro"不适合作为捆绑显示名称.但是,在iTunes中,我想看"Foo Bar"和"Foo Bar Pro".
我在iTunes中看到了很多其他具有很长名称的应用程序,并且它不是Bundle Display Name所显示的内容.对于我的生活,我无法弄清楚那个更长的名字输入的位置.我假设在Info.plist中.
有人可以帮忙吗?: - /
我有一个曾经是Objective-C的XCode项目,但现在包含了一些混合的Swift类.一切都是为了构建而设置的,我的桥接头和MyProject-Swift.h文件.所以没关系.
我的问题是,如果我正在查看Objective-C源代码并且我命令单击一个类或方法名称,而不是打开我的Swift文件,它会打开MyProject-Swift.h文件.这让我发疯,并迫使我在Swift文件上手动使用Quick Open.
有人知道怎么修这个东西吗?
我完全感到困惑,无法找到有关如何包装 UIKit 组件并正确调整其大小的文档。这是最简单的示例,包装 UILabel:
public struct SwiftUIText: UIViewRepresentable {
@Binding public var text: String
public init(text: Binding<String>) {
self._text = text
}
public func makeUIView(context: Context) -> UILabel {
UILabel(frame: .zero)
}
public func updateUIView(_ textField: UILabel, context: Context) {
textField.text = text
textField.textColor = .white
textField.backgroundColor = .black
}
}
Run Code Online (Sandbox Code Playgroud)
没什么特别的,只是一个现在可以用于 SwiftUI 的 UILabel。我将其包含在视图中:
var body: some View {
VStack {
Text("Hello, World!!! \(text)")
.font(.caption1Emphasized)
SwiftUIText(text: $helperText)
}
.background(Color.green)
}
Run Code Online (Sandbox Code Playgroud)
结果就是这个画面。请注意,顶部的 Text 只占用了所需的大小,但 SwiftUIText 占用了所有垂直空间。在代码的其他迭代中,我看到它缩小了并且不只占用少量的水平空间。
有人可以解释一下我如何指定我的组件应该 (A) 用完所有可用的宽度和 (B) …
这完全是iPhone的庸俗.我正在开发一个库,但已将我的问题缩小到非常简单的代码.这段代码的作用是创建一个50x50的视图,应用几度的旋转变换,然后将帧向下移动几次.结果是50x50视图现在看起来更大.
这是代码:
// a simple 50x50 view
UIView *redThing = [[UIView alloc] initWithFrame:CGRectMake(50, 50, 50, 50)];
redThing.backgroundColor = [UIColor redColor];
[self.view addSubview:redThing];
// rotate a small amount (as long as it's not 90 or 180, etc.)
redThing.transform = CGAffineTransformRotate(redThing.transform, 0.1234);
// move the view down 2 pixels
CGRect newFrame = CGRectMake(redThing.frame.origin.x, redThing.frame.origin.y + 2, redThing.frame.size.width, redThing.frame.size.height);
redThing.frame = newFrame;
// move the view down another 2 pixels
newFrame = CGRectMake(redThing.frame.origin.x, redThing.frame.origin.y + 2, redThing.frame.size.width, redThing.frame.size.height);
redThing.frame = newFrame;
// move …Run Code Online (Sandbox Code Playgroud) 我有一个问题,UIViewController#presentModalViewController被调用两次.我有一个模态视图,我试图提出另一个模态视图,但第二次没有任何反应.我怀疑它隐藏了吗?
还有其他人这样做过吗?
我一直在收到这个错误,但现在我根本无法运行我的应用程序.我甚至不知道bundleDebug是合法的目标......当我运行gradlew任务时它不会出现.
它不是特定于版本的,我通过两次更新看到了它.
其他人看到这个?
Gradle:
FAILURE: Could not determine which tasks to execute.
* What went wrong:
Task 'bundleDebug' not found in root project 'EpicMix'.
* Try:
Run gradle tasks to get a list of available tasks.
Run Code Online (Sandbox Code Playgroud)