w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Change custom UITableViewCell text color
Just add properties for the UILabels in the .h file of your custom cell class. Then in tableView:cellForRowAtIndexPath: do something like this: InventoryCustomCell *cell = (InventoryCustomCell *)[tableView dequeueReusableCellWithIdentifier:inventoryCellID forIndexPath:indexPath]; cell.yourTextLabel.textColor = [UIColor grayColor]; return cell;

Categories : Objective C

UISearchDisplayController with custom UITableViewCell at the second search lose UITableViewCell connection
i have to insert the custom setting of the UISearchDisplayController table view in this delegate method: - (void)searchDisplayController:(UISearchDisplayController *)controller didLoadSearchResultsTableView:(UITableView *)tableView { [searchDisplayController.searchResultsTableView setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"pattern_bg"]]]; [searchDisplayController.searchResultsTableView setSeparatorColor:[UIColor clearColor]]; [searchDisplayController.searchResultsTableView setSeparatorStyle:UITableViewCellSeparatorStyleNone]; UINib *myCellNib = [UINib nibWithNibName:@"MyCell_iPhone" bundle:[NSBundle mainBundle]]; [searchDisplayController.searchResultsTableView registerNib:myCellNib forCellReuseIdentifier:CellIdentifier]; [searchDisplayController.searchResultsT

Categories : IOS

iOS + Autolayout: UITableViewCell label + textfield width with rotation
You could try this answer it is a similar problem you are having and involves working with constraints : AutoLayout to keep view sizes proportional

Categories : Iphone

Custom Cell label text overlaps after core data save
The problem is that you are misusing the boilerplate configureCell method. If you look at Apple's template code you will notice that it is used to configure a fully created cell, i.e. populate it with data. The cell creation can be largely omitted when using storyboard. With storyboard, typically there is no need to create stuff in if (cell==nil) {...}. Of course you can still do it in code, if not in the if block also in a separate method, if you prefer. I would recommend to call this method createCell though, not configureCell. In configureCell: you can then put in your data - what you are already doing outside the if block in cellForRowAtIndexPath: That is actually the stuff that goes into configureCell. The way you are doing it now, you are creating new labels in the NSFetchedRe

Categories : Iphone

textfield don't save after editing
assign textfield delegate to self , and add this delegate method: - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { return NO; }

Categories : Objective C

Custom UIButton disappears when linked as IBOutlet in custom UITableViewCell
Did you set the UITableView delegate and dataSource in your XIB file and the protocols in the header file? @interface MerchantListController : UITableViewController <UITableViewDelegate, UITableViewDataSource> Also did you set the cell identifier? You also need to set the delegate methods of UITableView - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [self.merchantList count]; } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSString *cellIdentifier = @"MerchantListCell"; MerchantListCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; if (

Categories : IOS

objective-c how to save textfield values through textFieldShouldEndEditing:
Keep one global dictionary dctGlobal in your class. Set textfield.delegate=self in cellForRowAtIndexPath method. And then get and save value for text field in following method - (void)textFieldDidEndEditing:(UITextField *)textField [dctGlobal setObject:textField.text forKey: textField.placeholder]; On save, Use dctGlobal for saving into database. Thanks!

Categories : IOS

Display/disappear default text in TextField when user enters data/erase the text
You have to implement an IF-clause to your focusLost and focusGained Listener. So do something like this: public void focusLost(FocusEvent e) { if(txtFirstName.getText().trim().equals("")) txtFirstName.setText("First Name"); else //do nothing } And for focusGained(): public void focusGained(FocusEvent e) { if(txtFirstName.getText().trim().equals("First name")) txtFirstName.setText(""); else //do nothing } Or something like this ;)

Categories : Java

Capitalize the text in textfield as user types it without using css text-transform?
On keyup event. Just apply the method to convert to uppercase this.value.toUpperCase(); Check Fiddle But if you want the text to be in uppercase just before submitting the data. Then it is better you convert to upperCase once instead of binding it in keyup event.. // submit here var data = $('#input')[0].value.toUpperCase(); Change Event fiddle $("input").on('keyup', function(e) { if( [8,37,38].indexOf(e.keyCode) > -1 ) { return; } this.value = this.value.toUpperCase(); }); Another fiddle You can use the keycode and check if either backspace or arrow keys are pressed. Else capitalize or return it.

Categories : Javascript

custom textfield with two different color (inner and outer)
hmmm... i'm seeing three colors.. black, brown and yellowish brown. but in case there's only brown and yellowish brown. you don't need #search span anymore. you can just use border: 3px solid #c4a76e; for #search #txtSearch

Categories : CSS

how to dismiss keyboard of custom textfield in ios
[img1 respondsToSelector:[principal resignFirstResponder]]; First of all, respondsToSelector returns a BOOL which you use to determine if you can call a selector. This is not a void method, it appears that you have misunderstood that. Second, UIImageView does not respond to resignFirstResponder. Third, you are "passing in" void to respondsToSelector:, which I am surprised compiles? Ultimately what you want to do is call resignFirstResponder on your UITextField which would be achieved by calling [principal resignFirstResponder]. But, one of the easiest ways to dismiss the keyboard is by calling [self.view endEditing:YES] which is described to do ... Causes the view (or one of its embedded text fields) to resign the first responder status.

Categories : IOS

Two text colors in one UITableViewCell text label
This question addresses getting part of a string, which you would need to do. Instead of modifying the text with BOLD though, you can use this question to get an idea of how to change the color.

Categories : IOS

Filter tableView using custom search textField
Implement UITextFieldDelegate and the method - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string; In this method, when you write on your textfield, you can search text in your array and fill a filtered array. Then you reload your table with reloadData.

Categories : Iphone

How to define a custom UITableViewCell?
////Use LIke this - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ SetupCell *cell=(SetupCell*)[tableView cellForRowAtIndexPath:indexPath]; cell.setupFeedName.text =@"Hari kishan"; }

Categories : Iphone

Custom Reusable UITableViewCell
Might be your target would be remove from method . Please assign a break point at the strating of populate method and try to show or hide warrantyButton if target assign for check. and double check name of images. if(claim.hasWarranty) { UIImage *buttonImage; //13-6-2013 if([claim.warranty.name isEqualToString:@"Pending"]) { buttonImage = [UIImage imageNamed:@"imgBtnWarrantyPending.png"]; pendingHelp.hidden = NO; } else { pendingHelp.hidden = YES; buttonImage = [UIImage imageNamed:@"warranty_claimed"]; } [warrantyButton setBackgroundImage:buttonImage forState:UIControlStateNormal]; [warrantyButton setBackgroundImage:buttonImage forState:UIControlStateHighlighted]; [warra

Categories : IOS

uiscrollview in custom uitableviewcell
If you are using storyboard my guess is go and use the initWithCoder:(NSCoder *)coder; this method gets called after viewDidLoad and it might have something to do with this. It's pretty strange and i would comment normally to keep the discussion but the 50 reputation won't let me

Categories : IOS

creating custom UITableViewCell?
You have setup a wrong outlet connection. Its because you have connected your label's outlet to your file's owner. Remove that label outlet connection out of file's owner and connect the outlet pointing to your custom cell. It should work.

Categories : IOS

custom UITableViewCell to be used both with NIB and programmatically
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { [self createMyLabel:nil];// create your label here // Initialization code [self initalize]; } return self; } -(void)awakeFromNib { [super awakeFromNib]; [self initalize]; } -(void) initalize { //self.lblTitle.backgroundColor = [UIColor clearColor]; self.lblTitle.textAlignment = UITextAlignmentRight; self.lblTitle.font = [UIFont fontWithName:FONTRobotoRegular size:16]; self.lblTitle.textColor = RGBColor(0x5D350BFF); } -(void)createMyLabel:(id)sender{ //Creat

Categories : IOS

Can't set properties in Custom UITableViewCell
Its all about view hierarchy. You have to add your label outlet to the custom UITableViewCell, because it is the superView of your label in view heirarchy. That means label is contained in custom cell thats why you have add outlet to custom cell. self.view->tableView->CustomCellView->UILabel

Categories : IOS

UITableViewController and custom UITableViewCell
1) The cell must be a subclass of UITableViewCell. 2) No, I don't know why that didn't work, it should. Where were you trying to make the connection to? The cell or the table view controller? 3) Yes, I think this is the best way to do it. Have a different custom cell class for each different kind of cell, and make IBOutlets from the custom cell to its controls. Then just make one IBOutlet from the table view controller to the cell itself (you can then refer to the controls with something like self.cellType1.label1 ...). You don't need to do anything to initialize the cells if they're made in the storyboard.

Categories : Objective C

ios: custom UITableViewCell is blank
You should use the loadNibNamed: method in your cellForRowAtIndexPath: delegate method like this: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *cellIdentifier = @"Cell"; CustomCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; if(cell == nil) { NSArray *nibArray = [[NSBundle mainBundle] loadNibNamed:@"YourCustomCell.xib" owner:self options:nil]; for(id currentObject in nibArray){ if([currentObject isKindOfClass:[CustomCell class]]){ cell = (CustomCell *)currentObject; break; } } } return cell; }

Categories : IOS

iOS: Custom UITableViewCell from nib without a reuseIdentifier?
I think this is not a good way, but as per your requirement Use this: Write the init method in your CustomCell class - (id)init NSArray *nibObjects = [[NSBundle mainBundle] loadNibNamed:@"QuestionOptionCell" owner:self options:nil]; CustomCell *theEditView = [nibObjects objectAtIndex:0]; self = theEditView; theEditView = nil; return self } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { CustomCell *cell = [[CustomCell alloc] init]; if (cell == nil) { NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil]; cell = [topLevelObjects objectAtIndex:0]; } return cell; }

Categories : IOS

How to retain a text in textfield
The page is not refreshed, so that's not the problem. The problem is that you are using .innerHTML += to add the new elements. This is will destroy and recreate the existing elements: The elements are serialized to HTML, then you are concatenating the string to add new HTML and after the assignment the browser has to parse the HTML to create DOM Elements again. In this process all data will be lost. Use DOM manipulation methods instead. I.e. create the elements with document.createElement and add them with Node.appendChild. Using .innerHTML to override existing content or to initialize an element for the first time is OK. But using it to add elements to an existing element can lead to problems (as mentioned above) so it is better avoided in this case. Example: function addInput() {

Categories : Javascript

How best way to resize textfield to fit all text
TextField class has a getLineMetrics() method which returns TextLineMetrics. There are nice examples on both pages. You can get the number of text lines in a multiline text field with numLines() method.

Categories : Actionscript

Custom UITableViewCell width in iOS7
I ran into this same issue. My (grouped style)tableView used to have it's cells inset about 10 px on the left and right side. With iOS7 the content in grouped table views is stretched to the edges of the tableview. My fix was to adjust the width of the table view which would in turn adjust the width of the cells that it displays.

Categories : IOS

Custom UITableViewCell which reacts on touchDown
Create a custom cell and add an event handler to it using: - (void)addTarget:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents. Use the UIControlEventTouchDown constant as the third parameter. You can do anything you want in your own event handler. You might set your table view's allowSelection property to NO.

Categories : IOS

Custom UIView in UITableViewCell Issue
try to set the autoresizingMask for that view like... [_checkboxView setAutoresizingMask:UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleTopMargin]; ENJOY CODING.........

Categories : Iphone

Unable to view custom UITableViewCell in iOS
You don't show the 3 objects in the Master View cell. Change the 'Style' from Basic to Custom and drop in your objects. In the 'Identity Inspector' make sure to rename the Class to 'CustomTableCell'. Do the views (transaction, date & type) have properties in the CustomTableCell.h and are they connected to the 'CustomTableCell' in IB? Here's an image to point out the last two:

Categories : IOS

Custom UITableViewCell using UIAppearance proxy
// try this cell.accessoryType = UITableViewCellAccessoryNone; UIImageView *imgArrow = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 10, 15)] ; imgArrow.image = [UIImage imageNamed:@"table-arrow.png"]; cell.accessoryView = imgArrow; [imgArrow release]; imgArrow = nil;

Categories : IOS

UITableView is not using programmatic custom UITableViewCell
Are you running registerClass:forCellReuseIdentifier: or registerNib:forCellReuseIdentifier: after your tableView has been created? This is what tells your table view to use your custom class/nib when creating a cell. You would likely do this in the viewDidLoad method of your view controller. As of iOS 6 dequeueReusableCellWithIdentifier: always returns a cell if you have registered a class using one of the register???:forCellReuseIdentifier: methods. Previously it would return nil if a free cell was not available. You don't need to test cell == nil if you are building for iOS 6. EDIT: You mention this is a TableViewController. I assume this means your view controller is a subclass of UITableViewController. If this is the case there is already an instance if UITableView available via the

Categories : IOS

Hide UIButton in Custom UITableViewCell
Mistake in uppercase maybe ? [buttonCell.myButton setHidden:NO]; // Trying to access instance variable Instead of : [ButtonCell.myButton setHidden:NO]; // Trying to access class variable

Categories : IOS

UITableView inside a Custom UITableViewCell
I am suggesting u to go for master-detail view controllers :) ,for your question "have a UITableView inside a UITableViewCell " for this u need to subclass the UITableviewCell and in that cell u put or add another tableview by managing datasource and delegate in custom cell see my answer it shows how to add tableview within the custom UITableView cell see hear and before that u hav to incerease the row height for each cell i did not included it, "one thing i created all programatically not used xib" :) hope u get some idea .

Categories : Iphone

Where to addObserver to NSNotificationcenter in a custom UITableViewCell?
Generally speaking the cell shouldn't be observing anything. The controller should be observing changes and pushing the updated information onto the cells. Calling removeObserver: before adding the observer should work. If you were going to do anything in prepareForReuse or tableView:didEndDisplayingCell:forRowAtIndexPath: to reset the cell, that would be the code you use. You need to look at how you tested that it wasn't working and how you're reusing cells.

Categories : IOS

Custom UITableViewCell Indentation Issue
Check the code below UIImageView *imageView = (UIImageView *)[tableView viewWithTag:1]; [imageView setImage:[UIImage imageNamed:@"image-placeholder"]]; //Put the code below [imageView setClipsToBounds:YES]; and, [feedCell.imageView setImage:[UIImage imageNamed:@"image-placeholder"]]; [feedCell.imageView setClipsToBounds:YES];

Categories : IOS

How can I get a custom UITableViewCell from a TableView using cellForRowAtIndexPath?
You are already getting an instance of AddSubjectDetailsCell back, it is just being returned to you typed as the parent type UITableViewCell because that is all the UITableView knows. All you've got to do is cast it to it's specific type like this: AddSubjectDetailsCell *cell; NSIndexPath *indexPath = [[NSIndexPath alloc] initWithIndex:i]; cell = (AddSubjectDetailsCell *)[tableView cellForRowAtIndexPath:indexPath];

Categories : Objective C

How to generate custom table view based on textfield input?
Have you gone through this !? UISearchDisplayController

Categories : Iphone

Add text to an inactive viewcontroller's textfield
When you create an object for AthleteDetail AthleteDetail *athleteDetail= [self.storyboard instantiateViewControllerWithIdentifier:@"showAthlete"]; it does not initialise the controls subviewed. The best way to get the desired the behaviour is to create a property named "athleteName" in AthleteDetail class @property(nonatomic, strong) NSString * athleteName now instead of athleteDetail.firstDetailTextField.text = athlete.first; write the following code athleteDetail.athleteName = athlete.first; now in viewDidLoad of AthleteDetail class, assign athleteName to your textfield firstDetailTextField.text = _athleteName; I hope this works for you.. :)

Categories : IOS

how to get the html text length without set it to a textfield?
I see two ways to extract the text from xml: For the xHTML the best way is to parse it to XML and extract all text nodes For all types of text you can try RegExp that matches text that is not part of a HTML tag (http://regexr.com?363li) var s:String = "<p>This is <b>some</b> content to <i>render</i> as <u>HTML</u> text.</p>"; //by TextField var tf:TextField = new TextField(); tf.htmlText = s; trace(tf.text); trace(tf.length); //well-formed XML XML.ignoreWhitespace = false; var x:XML = new XML(s); var t:String = ""; var list:XMLList = x..*; for each(var node:XML in list) if(node.nodeKind() == "text") t += node; trace(t); trace(t.length); //by RegExp (non wel formed XML) var match:Array = s.match(/(?<=^|>)[^><]+?

Categories : HTML

Can you detect if a textfield has highlighted text
Yes, since UITextField (and I believe UITextView) adopt the UITextInput protocol, you can send messages to those with any of that protocols methods, included selectedTextRange. See UITextInput Protocol Reference.

Categories : IOS

TextField text not displaying from UIPopOverView
pass your parent class object to your popovercontroller class and you'll be able to have access of the parent class property in child class and then you'll be able to set your textfield value selection on picker from popovercontroller class

Categories : IOS



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.