custom-cell

Custom UITableViewCell in edit mode does not move my UILabels

跟風遠走 提交于 2019-11-30 09:13:40
This is doing my head in:-) I have a fully functional CoreData Populated UITableView inside a UIViewController and I have successfully implemented the "Swipe to Delete option" (which is easy) and I can also delete single instances with an edit button where the red circle thingy comes up. My problem is, and I think it is because I have a CustomCell, that when I press the edit button the UILabels do not move to the right. I have tried using -(void)layoutSubViews and a few others, but nothing works. I have posted my code for my cellForRowAtIndexPath . This is part of a note section in my app.

How to add a separator space between rows on custom Xamarin.Forms ViewCell?

坚强是说给别人听的谎言 提交于 2019-11-30 07:36:43
In this question on Xamarin Forums https://forums.xamarin.com/discussion/20517/curved-corners-in-tableview-cells Craig Dunn teaches how to create a cell with frame. I want to Add a space between each cell. At present the cells seems glued, and the ViewCell doesn`t have a space property. Thanks! You just have to customize the layout of the MenuCell further to achieve this. Shown below is a version that uses a further Xamarin.Forms.Frame to create a spacing between each item with a couple other modifications:- XAML Page:- <ListView x:Name="lstItems" /> XAML Code-Behind:- lstItems.ItemTemplate =

How add custom image to uitableview cell swipe to delete

泪湿孤枕 提交于 2019-11-30 07:23:26
Could you tell me, how to add custom image to delete button when swipe cell on UITableview? search you need function "editActionsForRowAtIndexPath", where you create scope of actions. You need to set UIImage to backgroundColor of UITableViewRowAction. let someAction = UITableViewRowAction(style: .Default, title: "") { value in println("button did tapped!") } someAction.backgroundColor = UIColor(patternImage: UIImage(named: "myImage")!) 来源: https://stackoverflow.com/questions/29335104/how-add-custom-image-to-uitableview-cell-swipe-to-delete

Pass a method from my custom cells class to the main class

扶醉桌前 提交于 2019-11-29 18:11:24
I have a custom cell. In it is a UITextField linked to customCell.m . I'm trying to pass the text from the textField to mainVC.m . I have a public method in customCell.m : - (NSString *)PassText{ return self.myTextField.text; } How can I pass that method to a string in my mainVC.m ? What you need to do is: Define a protocol Add a property of this protocol for your CustomCell Implement the protocol in your MainVC 1. Define a protocol We normally put the definition of the protocol in the header file (in this case CustomCell.h ). // define the protocol for the delegate @protocol

Iphone Application:-My Application Crash

雨燕双飞 提交于 2019-11-29 18:04:28
I make one custom cell class like this. - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { /*imgview=[[UIImageView alloc]initWithFrame:CGRectMake(10, 15, 40, 20)]; imgview.backgroundColor = [UIColor clearColor]; imgview.opaque = NO;*/ Name = [[UILabel alloc]initWithFrame:CGRectMake(75, 10, 130, 30)]; Name.backgroundColor = [UIColor clearColor]; Name.textColor=[UIColor blueColor]; Name.font=[UIFont fontWithName:@"Arial" size:16.0]; Name.textAlignment=NSTextAlignmentLeft;

How to setup a NSTableView with a custom cell using a subview

社会主义新天地 提交于 2019-11-29 17:23:35
I am trying to setup a NSTableView with a custom cell using an ArrayController and Bindings . To accomplish this I added a subview to the custom cell. The data connection seems to work somewhat. Though, there seems to be a redraw problem which I cannot fix. When I load the application only some of the cells are rendered. When I scroll through the rows or select one the rendering changes. I created an example project on github to illustrate what the problem is. The actual source code for the cell rendering can be found here : // CustomCell.m - (void)drawInteriorWithFrame:(NSRect)cellFrame

Unable to make view equal width to cell in iOS?

拜拜、爱过 提交于 2019-11-29 11:27:02
I am making a custom cell in iOS.I have added prototype cell.I m trying to add a view inside a cell of equal width to parent cell.But the width of cell is not equal please tell me how should i do it? Constraints are: View structure: EDIT: In preview on iPad it does not show complete view .But on actual device it works fine.Why? sample here https://drive.google.com/file/d/0B7RGQm8-8k24Q0tXUFZOLUZFQk0/view?usp=sharing As I checked your sample project I found that You made your viewController size to iPhone4.7 inch ...and I checked the source code of storyboard and I found that targetRuntime="iOS

ListView or TableLayout?

*爱你&永不变心* 提交于 2019-11-28 16:33:39
I am really confused now as to which one to learn. I am an iPhone app developer and now learning Android development. I have learnt how to use a ListView with a static array of strings using an Adapter . I am used to using custom cells in iPhone, mostly for showing dynamic content like images and text in TableView s. So which is the way to go for doing that in Android? TableLayout or ListView ? As others have already said in comments, you need to clearly define what you want to do first before making a concrete decision on which type of layout to use. However, I can certainly understand the

Pass a method from my custom cells class to the main class

大憨熊 提交于 2019-11-28 13:25:23
问题 I have a custom cell. In it is a UITextField linked to customCell.m . I'm trying to pass the text from the textField to mainVC.m . I have a public method in customCell.m : - (NSString *)PassText{ return self.myTextField.text; } How can I pass that method to a string in my mainVC.m ? 回答1: What you need to do is: Define a protocol Add a property of this protocol for your CustomCell Implement the protocol in your MainVC 1. Define a protocol We normally put the definition of the protocol in the

Swift: IBoutlets are nil in Custom Cell

喜欢而已 提交于 2019-11-28 12:23:42
I can't figure out why this custom cell is not being output. I have a custom cell set up in a storyboard (no nib). I have a text field and 2 labels which are nil when I try to access them in the custom cell class. I'm almost sure I have everything hooked up correctly, but still getting nil. I've selected my table cell in the storyboard and set Custom Class to TimesheetTableViewCell I've also control clicked on the table and set the datasource and delegate to be TimesheetViewController My custom cell class: import UIKit class TimesheetTableViewCell: UITableViewCell { @IBOutlet var duration: