UITableView Rounded Custom Cells (w/ image) [closed] - objective-c

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have quite a daunting challenge. I want to make this:
So:
I use a table (plain not grouped cells).
Cells must have rounded corners & shadow.
I would prefer to use CGRect to draw the cells instead of using images (for speed & space economy).
The cells in their most basic form look like Cell 1, but some have extra checkboxes like Cell 2.
Tutorials that say to use images as background for rounded cells never touch on the point about sliding the cell to reveal actions. I think that by using an image the entire frame of the cell will slide and look really awkward. How can that be overcome?
Is it possible to mix cells? Regarding adding checkboxes I though of 2 ways. Either extend the entire cell downwards and add the checkboxes & text OR just add a 2nd cell type specifically made for checkboxes (I prefer this option but I don't know if it's possible to mix cell types).
NOTE: The cell is the ENTIRE rounded rectangle, not just the upper part (The upper part is the title). They grey line is only for style and will be just an image.
I won't ask about a specific way of doing this. Each has it's own way of doing things. If you know how to do one of the things above (except creating a table view :) ), please help me (but keep in mind that it must be compatible with the rest)!
Note 2: Swift is preferred but Obj-C is fine too (unless code can't be ported to Swift).
Thanks!

i would create custom table view cells for your table view by subclassing UITableViewCell, assigning it to your table view, and from there you would be able to customize the cell with a UIView and customize the .layer.cornerRadius including all the shadow properties on .layer

Related

Selecting links in NSTextField or NSTextView using keyboard Tabs, like NSButton [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I have a window in my macOS app which consists of buttons and text with hyperlinks. I created hyperlinks in NSTextView using NSAttributedString.
The question is: Can I allow a user to move focus between buttons and links in the text so that they could Enter/Space that links without using a mouse. Basically, the question is how can I achieve moving firstResponder from a button to a link in the NSTextView's text?
This picture is an example of what I exactly need as a result:
NSTextView does not support focus on regions of text in that manner. If you were to implement some kind of focus in a custom text view, you'd have to handle the focus nativation methods (eg, pressing the tab key), manually parse the text view to find regions you want to focus on, cycle to the next one, and draw some kind of highlighting, whether by using custom drawing, using temporary attributes on the text itself, or perhaps even just moving the selection range. Either way, you will have to do all of that input handling and "focus" movement yourself.
As for merely having clickable links in a text view, the range of text for the link needs to have the NSLinkAttributeName attribute, with the NSURL as the value. See:
https://developer.apple.com/library/content/qa/qa1487/_index.html
http://travisjeffery.com/b/2013/11/url-linking-in-a-non-editable-nstextview/

Table View not stretching vertically iPhone 6 [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
The tableview isn't stretching all the way vertically in iPhone 6 or iPhone 6 Plus.
Any ideas why this is happening? Thanks!
Storyboard:
UPDATE:
This question was actually really helpful in another thing to check for as to why the tableview was getting cut off: Why is my UITableView cut off in iOS 7?
There's a whole bunch of things you want to check for if your Table View Cell are getting cut off:
- are they pinned to superview or content view?
- are the constraints such that you are cutting off content without knowing it?
- is a navigation bar or tab bar cutting off content?
- check the auto resizing mask or add one if need be settingsTable.autoresizingMask &= ~UIViewAutoresizingFlexibleBottomMargin;
And multiple other reasons. Its tricky, so if you come across this Q+A and need help, just drop a note and will help!
Select your tableView and pres Pin (a litte square icon with lines on the sides down in Xcode). Then add the bottom constraint (click here, it will turn red) and set value 0. Enjoy

Moving and resizing the Rectangle inside the Canvas In Windows 8 [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
How I can move and resize a rectangle inside the Canvas horizontally in windows 8. I am trying to create a scale like control in my application. It will work like I can resize the rectangle horizontally and also it is possible to move the rectangle inside the canvas. Based on the rectangle position I will calculate the scale value. But when I try for the same I get stuck with resizing the rectangle(Drag on the left and right side of the rectangle to expand). Please anyone guide me to develop the same. No need to take effort for creating a sample for me. Just guide me, I will do the rest.
It sounds to me like you are trying to allow for two different operations with the same gesture (single point of contact that moves on the surface). The behavior sounds to me like you want the rectangle to resize horizontally when you drag on the far left of right of it and to move around on the canvas when you drag anywhere else on it (please correct me if this is wrong).
I would think that you would want to use the Scale gesture for the resizing and a Translate gesture for the movement. In the past I have used UIElement.ManipulationMode with handlers for the appropriate manipulation events (e.g. ManipulationStarted, ManipulationCompleted, etc). I have also seen some mention of using GestureRecognizer but haven't used it directly myself.
Once you have each action (drag or resize) managed by a distinct gesture you should just be able to update the size of the Rectangle by either directly changing its height and width values or by using a ScaleTransform.

How to add views on a scroll view that can later be viewed dynamically. Objective C [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
Suppose that I have an object named Topic. And inside that topic I can create Messages. The most recent messages needs to be the first message on the list (This is already done). My problem is that I need to show the messages in a view that can be scrolled either right or left (Right to show the older messages, and left to go back to the newer messages). Imagine an image collection that can be scrolled sideways in a ScrollView, that how this should look like. Since the messages is being add by the user, I can't use UIImage.
Any opinions how I should deal with this? or do you know any tutorial links that can help me? Thanks.
I have found Apple's Street Scroller demo application a good source of inspiration for doing something similar to what you propose. Although the demo seems to stress the "infinite scrolling" aspect, it also demonstrates how one can achieve a smoothly scrolling view that is populated with small detail views - in your case those small detail views would be used to show details about a message.
<self-advertisement>The demo is fairly basic, it is far away from some piece of library code that can be just dropped into an app and will work out-of-the-box. In my own app I have made an attempt at generalizing the concept and writing a reusable class that provides seamless (i.e. not paginated) scrolling through a finite number of item views. In case you are interested, have a look at the ItemScrollView class in this GitHub repo. As always, YMMV.</self-advertisement>
Maybe you can use this scrollview just create a cell containing a label which will hold the message and pass the array of message just like you use an array for populating tableview cell. This scrollview will also take care of reusing your views. :)
so no need to worry about memory.
Just implement below datasource methods
-(VSScrollViewCell *)vsscrollView:(VSScrollView *)scrollView viewAtPosition:(int)position;
// implement this to tell VSScrollview the view at position "position" . This view is VSScrollviewCell or subclass of VSScrollviewCell.
-(NSUInteger)numberOfViewInvsscrollview:(VSScrollView *)scrollview;
// implement this to tell VSScrollview about number of views you want in VSSCrollview.
by default, height and width of cell will be bounds of scrollview and spacing between cell will be 0, which you can customize using other datasource methods listed in readme.

Photoshop: Copy and paste an image without trimming transparency [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I have an image fo this kind:
1000x1000 but only a portion of the image is opaque, think a filled circle on the left, other picels are transparent.
I want to copy/paste only a portion of the image with an area choosed by me:
I drag and drop the mouse so that part will be 400x100 but when i paste i have an image 300x76.
photoshop has trimmed my image, but i want it with the border of the image choosed by me, i want that coordinates.
preparing an image 400x100 blank and copying that image doesn't solve my problem because i must pan the image on the original position.
how can i copy/paste the image without trimming?
thanks
Your problem is because you're asking Photoshop to take into account an area that doesn't exist (it's transparent). You cannot "Copy" an area where nothing exists in Photoshop. Your only option is to place something (a colour) in the corners where the transparency exists, select your area, Copy Merged (using CTRL + SHIFT + C) and then delete the extra colour once you've pasted it.
There's no other way around it.
it depends by which method you are doing copy paste.
i suggest you to use marquee tool.
select marquee tool
drag it to your desired area,now copy and than paste it.,if its not copying the thing press cntrl+shift+c because most of the time,Photoshop memory don't behave dynamically.