You need to decrease priority of content resistance in makeUIView
(so content would not push external layout set in SwiftUI) like below
func makeUIView(context: UIViewRepresentableContext<MyField>) -> UITextField {
let field = UITextField(frame: .zero)
field.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
...