我目前正在使用Xcode 6预发行版(非测试版)和OS X 10.10 Yosemite beta 7上的模拟器.我正在尝试构建一个在xcode 6中开发的项目,但每当我打开某个视图控制器时应用程序崩溃.这个视图控制器字面上没有代码(它是一个空的,静态的,表视图控制器,有几个默认的单元格和标签).
给出的错误是:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason:
'scaledValueForValue: called on a font that doesn't have a text style set'
Run Code Online (Sandbox Code Playgroud)
就在我得到这个断言失败之前:
*** Assertion failure in -[UICTFont _scaledValueForValue:],
/SourceCache/UIFoundation_Sim/UIFoundation-371/UIFoundation/iOS/UIFont.m:496
Run Code Online (Sandbox Code Playgroud)
我真的不知道发生了什么,我尝试在VC中设置断点,但是在调用viewDidLoad方法之后发生了错误(因此在执行了所有代码之后).
有任何想法吗?我项目中所有内容的字体都是'Baskerville',我尝试过改变它,但它不会影响崩溃.
哦,如果我使用Xcode 5,它可以正常工作.
更新9/24:所以我仍然无法弄清楚这一点.我尝试使用fontWithDescriptor方法,但它仍然崩溃.有趣的是,我有很多页面使用自定义字体,大多数工作正常,但有两个VC,当我去他们时立即崩溃...其中一个甚至没有任何自定义字体.我非常感谢您的所有反馈,但有没有人有任何其他想法/修复?我正在使用Xcode的正式版本,它仍然无法正常工作.
我最近升级到Xcode 10并开始更新我们的应用程序以切换4.2的过程在重建第三方框架并为各种问题添加变通方法一天左右之后,我能够在新的模拟器上运行我们的应用程序.
但是,当我尝试在我的个人电话上运行(运行iOS 12.0 GM)时,我在安装应用程序时遇到了错误,如标题中所述.
我知道在SO和互联网上有很多关于这个主题的已经 回答的 问题,但是我无法让这些问题起作用.
它已经阻止了我一天半左右,所以我想知道是否有人对如何减轻这种情况有任何见解.
到目前为止我采取的步骤还没有奏效(也许他们将来会为其他人工作!):
code sign on copy检查所有复制的框架Developer,而不是Distribution任何帮助将不胜感激 :)
更新:我尝试在新机器上从头开始重新下载和重建,并出现同样的问题.有趣的是,我可以存档和验证应用程序就好了.
还尝试使用相同的包ID签署一个空项目,它工作正常.所以问题出在我们的第三方框架或者从Xcode 9.4过渡时启用的一些奇怪的设置.开始逐个删除第三方框架,直到我可以编译它.
更新2:仍然没有运气.试图清除大多数框架而没有任何东西.这是设备日志,想知道是否Skipping a profile because of error 0xe8008012与它有关:
https://gist.github.com/joshuawright11/6889ce1a0872262df77f97d63830baa5
更新3 …
我试图做一个模糊的背景UITabBar对我UITabViewController,这种想法是有它变得模糊,透明,这样的观点下可以看到滚动的.
不幸的是,我不能为我的生活让标签栏变得透明.无论我做什么,标签栏总会有一些黑色背景,阻止底层视图控制器显示.
如果我将alpha的alpha更改为UITabBar低,我可以看到tableview确实在它后面,但你可以看到它UITabBar有某种背景,阻止tableview完全显示(我不想要禁止按钮项目不可见,只是标签栏背景).
怎么会这样?
在自定义标签栏的视图中我确实加载了:
self.tabBar.translucent = true
self.tabBar.alpha = 0.3
self.tabBar.backgroundColor = UIColor.clearColor().colorWithAlphaComponent(0.0)
self.tabBar.layer.backgroundColor = UIColor.clearColor().colorWithAlphaComponent(0.0).CGColor
self.tabBar.backgroundImage = nil
self.tabBar.shadowImage = nil
Run Code Online (Sandbox Code Playgroud)
在AppDelegate我有:
UITabBar.appearance().barTintColor = UIColor.clearColor()
UITabBar.appearance().tintColor = kColorAccent
UITabBar.appearance().translucent = true
UITabBar.appearance().translucent = true
UITabBar.appearance().backgroundColor = UIColor.clearColor()
UITabBar.appearance().backgroundImage = nil
UITabBar.appearance().layer.backgroundColor = UIColor.clearColor().CGColor
UITabBar.appearance().shadowImage = nil
Run Code Online (Sandbox Code Playgroud)
...是的它太过分但我想尝试一切.
关于该怎么做的任何想法?
我正在尝试复制这个答案:设置包含布局的子元素的属性
我有一个简单的custom_edit_text.xml:
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable name="hint123" type="String" />
</data>
<android.support.design.widget.TextInputLayout
android:id="@+id/emailInputLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<android.support.v7.widget.AppCompatEditText
android:id="@+id/emailField"
android:layout_width="275dp"
android:layout_height="wrap_content"
android:paddingBottom="16dp"
android:paddingTop="14dp"
android:hint="@{hint123}"
android:textCursorDrawable="@null"
android:background="@drawable/edit_text_background"
android:fontFamily="@font/eina_regular"
android:textColor="@color/edit_text_color"
android:textColorHint="@color/edit_text_color"
android:textSize="15sp"
/>
</android.support.design.widget.TextInputLayout>
</layout>
Run Code Online (Sandbox Code Playgroud)
我将它包含在另一个文件中:
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<include
layout="@layout/custom_edit_text"
app:hint123="Email"/>
</layout>
Run Code Online (Sandbox Code Playgroud)
但是,该项目在清理和重建后拒绝编译并出现错误:
AAPT: error: attribute hint123 (aka inc.company.appname:hint123) not found.
有任何想法吗?
我也有
dataBinding {
enabled = true
}
Run Code Online (Sandbox Code Playgroud)
在应用级别启用 build.gradle
我目前正在为Android制作一个Geofencing应用程序,我按照他们的教程但我似乎无法正确触发BroadcastReceiver.
调用onAddGeofencesResult,但是从未调用BroadcastReceiver.想法为什么?我有它,如果一个人在地理围栏中超过5毫秒,以及退出或进入地理围栏,它应该发送广播.我根据我办公室附近的坐标制作了地理围栏,但在走过它们(或站在它们中)时没有得到任何结果.
ReceiveTransitionsBroadcastReceiver.java:
import com.parse.ParseObject;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
/**
* This class receives geofence transition events from Location Services, in the
* form of an Intent containing the transition type and geofence id(s) that triggered
* the event.
*/
public class ReceiveTransitionsBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context arg0, Intent arg1) {
System.out.println("Hello");
ParseObject gameScore = new ParseObject("EventTest");
gameScore.put("Student", "Josh");
gameScore.put("Entered", true);
gameScore.put("Class", "AndroidTest");
gameScore.saveInBackground();
}
}
Run Code Online (Sandbox Code Playgroud)
表现:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.spotter" …Run Code Online (Sandbox Code Playgroud) 我目前正在尝试制作一个自我调整大小的tableview(其中单元格自动调整以适应其内部视图的自动布局).
其中一个单元格中有一个tableview.这个想法是单元格应该是tableview的contentSize.height的大小.
我将UITableView子类化为完成此任务,当tableview加载时,它看起来很棒.但是,这个错误会被吐出:
[Assert] UITableView internal inconsistency: _visibleRows and _visibleCells must be of same length. _visibleRows: {0, 4}; _visibleCells.count: 8, _visibleCells:
此外,当我尝试在此错误后滚动tableview时,会出现非常奇怪的行为,并且tableview会启动layoutsubviews的无限循环.
知道这个错误意味着什么吗?我无法在互联网上找到任何实质性引用此错误的内容.提前致谢!
我有一个使用javafx场景渲染的应用程序,我想把它渲染到我制作的GUI中,也在javafx中.我该怎么办?
基本上是有一些容器,我可以把场景放入,然后将该容器放入GUI.
对不起,如果这是一个新手问题,我是JavaFX的新手
使用 SwiftUI,我试图将 aView在屏幕上居中,然后给它一个可变高度的页眉和/或页脚。
使用约束,它看起来像这样:
let view = ...
let header = ...
let footer = ...
view.centerInParent()
header.pinBottomToTop(of: view)
footer.pinTopToBottom(of: view)
Run Code Online (Sandbox Code Playgroud)
这样view,无论页眉和页脚的大小如何,都将始终位于屏幕中央。
我不知道如何用 SwiftUI 来完成这个。使用任何类型的HStack或VStack意味着 的大小header并footer推动view。我想避免硬编码任何高度,因为中心的view大小也可能不同。
有任何想法吗?SwiftUI 的新手,因此非常感谢您的建议!
我目前正在使用 githubs v3 api 开发一个项目,我正在尝试找到一种方法来获取用户拥有和正在观看的所有存储库中的所有问题。我怎样才能做到这一点?/user/issues 和 /issues 仅返回分配给某人的问题。
我有几个视图包含具有一些不同内容的相同按钮。因此,我制作了一个ContainerView包含共享Button布局的文件,并为通用ContentView.
我希望在点击按钮ContentView时做出响应ContainerView。
使用 UIKit,我将持有对ContentViewin 的引用,并在ContainerView按下按钮时调用它的函数。但是,因为 SwiftUI 将所有视图都作为结构体,所以contentView在放入ContainerView的body. 因此参考和显示ContentView是不同的,我无法向子视图发送消息。
代码:
struct ContainerView: View {
let contentView = ContentView()
var body: some View {
Group {
/// When this button is tapped, I would like to send a message to the `ContentView`.
Button(action: self.reset, label: { Text("RESET") })
/// Unfortunately, this seemes to send a copy of the `contentView`. So …Run Code Online (Sandbox Code Playgroud) ios ×6
swift ×3
android ×2
java ×2
swiftui ×2
xcode ×2
code-signing ×1
github ×1
github-api ×1
ios12 ×1
ios8 ×1
ios9 ×1
javafx ×1
javafx-2 ×1
objective-c ×1
uitableview ×1
xcode10 ×1
xcode6 ×1
xml ×1