Search results for

column

2,048 results found

Post

Replies

Boosts

Views

Activity

Change Navigation Stack columns dimensions
Hi. I'm writing the following code for a navigation with images and I have an issue: the images don't fit with the automatic rectangle that is created by the NavigationStack view. Here is the code and I'm attaching an image too for you to understand : import SwiftUI struct LycéesListe: View { var body: some View { NavigationStack { List(lycées) { lycée in NavigationLink { LycéeDétail(lycée: lycée) } label: { LycéesRow(lycée: lycée) } } .navigationTitle(Lycées) } } struct LycéesListe_Previews: PreviewProvider { static var previews: some View { ForEach([iPhone 13, iPhone 12], id: .self) { deviceName in LycéesListe() .previewDevice(PreviewDevice(rawValue: deviceName)) .previewDisplayName(deviceName) } } } } Anyone knows how I could make the images fit with the rectangle border so I just have images with clean rectangles and not these green lines ? I tried to do padding but it didn't help. Any answer appreciated.
0
0
712
May ’23
Reply to Constraints between a UITableView and a UITableViewCell
I would recommend trying to use the same relationships to position your column headers and the views in the cells. Have a view that is the same width as the tableview. The column headers would be subviews of that view. The positions of the column header views would be relative to the container view. Set up the cells to use the same relationships relative to the cell content view.
Topic: UI Frameworks SubTopic: UIKit Tags:
Nov ’15
Reply to Checkbox in NSTableView
If I drag a table view to the controller it defaults to two columns. I then grab a check cell and drag it to the second column and IB adds a little Table Column text. I let go, and the same thing as above happens.As to dragging into the hierarchy directly, xcode will ONLY let me drop it in place of the very last cell. The one that's light blue and says Text Cell.
Topic: UI Frameworks SubTopic: AppKit Tags:
Mar ’16
Reply to Read CSV file, parse into arrays, Swift 4, Xcode 9 broken, Xcode 8.3 OK
As with most things in programming, it pays to break down your problem into parts:Reading a fileBreaking it into linesBreaking the lines in columnsConverting a string to the appropriate data valueI’ll cover each in turn.If you’re just getting started, a good place to start is a command line tool. This avoids the need for dealing with file selection dialogs, the App Sandbox, and so on. Here’s a tiny shell command line tool that’ll get you going:import Foundation func process(string: String) throws { … your code here … } func processFile(at url: URL) throws { let s = try String(contentsOf: url) try process(string: s) } func main() { guard CommandLine.arguments.count > 1 else { print(usage: (CommandLine.arguments[0]) file...) return } for path in CommandLine.arguments[1...] { do { let u = URL(fileURLWithPath: path) try processFile(at: u) } catch { print(error processing: (path): (error)) } } } main() exit(EXIT_SUCCESS)Note I’ve made some shortcuts here (like assuming the file is UTF-8 and printing errors to s
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’17
Reply to How to get the output of a for-in loop into a single DataFrame instead of many Dataframes
Hello @AnimalOnDrums, While you could use a for loop to append elements to your Column instances one by one, you might prefer to leverage the fact that Album's tracks are returned as a MusicItemCollection, which like most collections has the map(_:) method. let albumTracks = album.tracks ?? [] var dataFrame = DataFrame() let trackNumberColumn = Column(name: track, contents: albumTracks.map(.trackNumber)) dataFrame.append(column: trackNumberColumn) let titleColumn = Column(name: title, contents: albumTracks.map(.title)) dataFrame.append(column: titleColumn) let artistColumn = Column(name: artist, contents: albumTracks.map(.artistName)) dataFrame.append(column: artistColumn) let releaseDateColumn = Column(name: release date, contents: albumTracks.map { track in return track.releaseDate?.formatted(date: .long, time: .omitted) }) dataFrame.append(column: releaseDateColumn) let durationColumn = Column(name: duration, contents
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’22
Reply to Make method less repetative
Again, I may be reading your code incorrect but something like:private func generateLoserLocationFunction(numberOfPlayers: Int) -> (column: Int, row: Int) -> (column: Int, row: Int) {return { row, column inlet newCol = -2 * columnswitch numberOfPlayers {case 8:switch column {case 0:return (newCol, row / 2)case 1:return (newCol, row ^ 1)}case 16:switch column {case 0:return (newCol, row / 2)case 1:return (newCol, 3 - row)case 2:return (newCol, row ^ 1)}case 32:switch column {case 0:return (newCol, row / 2)case 1:return (newCol, (row + 4) % 8)case 2:return (newCol, row)case 3:return (newCol, row ^ 1)}default:return (newCol,0)}}It's not a big change, 35 lines instead of 50 but if I'm reading it right, it should do the same thing your existing versiondoes.
Topic: Programming Languages SubTopic: Swift Tags:
Sep ’15
Reply to process name in custom instrument
Thank you so much! Knew there was some secret incantation somewhere 🙂 <ktrace-interval-schema> <id>com-google-dyld-launch-executable-schema</id> <title>dyld launch executable</title> <start-pattern> <class>31</class> <subclass>7</subclass> <code>1</code> <function>1</function> <thread>?thread</thread> </start-pattern> <end-pattern> <class>31</class> <subclass>7</subclass> <code>1</code> <function>2</function> </end-pattern> <start-column> <mnemonic>start</mnemonic> <title>Start</title> <type>start-time</type> </start-column> <duration-column> <mnemonic>duration</mnemonic> <title>Duration</title> <type>duration</type> </duration-column> <column> <mnemonic>process</mnemonic> <title>Process
Jan ’19
Reply to NSBrowser....conditionally suppress right-click menu
Yeah, the getter for menu gets called from the addColumn method. It seems that everytime NSBrowser adds a column, it sets the menu for that column (whatever view it uses for the column) to be its menu. The main view used to create each column, far as I can tell is private API.What I'm going to try is:1) Setting the menu directly for each cell.2), Setting a different menu for the browser.3) Take hack-ish measures to validate the browser's menu to block it from being shown by hiding all the menu items when necessary.If there is a more elegant way to this, I'd love to know.
Topic: UI Frameworks SubTopic: AppKit Tags:
Jul ’15
Reply to Using Web https to install app, the app is in waiting... state on the device
If you plug the device in to your Mac and view the console output in Xcode while installing the app from your web server, what errors do you see? (In Xcode, Window > Devices, choose device on left column, look at the bottom part of the right column. You may need to click the upward pointing triangle in the bottom left corner of the right hand column to show the console output.)
Feb ’16