Related to this
I am trying to make an app based on Notes app.
I set my iPhone text size to the smallest, and when the view changes, the texts on new view’s toolbar gets bigger.
Code :
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
HStack {
Button {
parentList.starred.toggle()
} label: {
Label("Toggle Favorite", systemImage: parentList.starred ? "star.fill" : "star")
.labelStyle(.iconOnly)
.foregroundColor(parentList.starred ? .yellow : .gray)
}
Button(action: editList) {
Label("Edit List", systemImage: "ellipsis.circle")
}
EditButton()
}
}
ToolbarItem(placement: .bottomBar) {
Spacer()
}
ToolbarItem(placement: .status) {
if parentList.childvocabularies!.count == nil {
Text("")
.foregroundColor(.secondary)
.font(.caption)
}
else if parentList.childvocabularies!.count == 1{
Text("(parentList.childvocabularies!.count) Vocabulary")
.foregroundColor(.secondary)
.font(.caption)
} else {
Text("(parentList.childvocabularies!.count) Vocabularies")
.foregroundColor(.secondary)
.font(.caption)
}
}
ToolbarItem(placement: .bottomBar) {
Button(action: addItem) {
Label("Add Item", systemImage: "plus")
}
}
}
Is this a bug?
2
Answers
This bug is solved in iOS 16 beta.
While this introduces other issues (like changing left padding), you can try:
Minimum scale factor prevents the font size from increasing and fixed size prevents the text from being truncated. Bold font is our custom extension getting our custom font in bold.