天道酬勤,学无止境

uitableview

UILabel inside nested UIStackViews inside UITableViewCell sometimes truncating

I have a tableview cell in one of my tables setup as containing the following view hierarchy The outer horizontal stackview is pinned to the cell's content view on trailing, leading, bottom and top edges. The right label is pinned to its parent stackViewHackView on trailing, leading, bottom and top edges Within my controllers code I've got the cells setup to be dynamic height to fit the content of the cells so they can grow or shrink depending on the content size tableView.rowHeight = UITableViewAutomaticDimension tableView.estimatedRowHeight = 30.0 Regarding Auto layout setup. (Relevant

2022-01-19 02:40:19    分类:问答    ios   uitableview   autolayout   uilabel   uistackview

sectioned tableview index selection highlighting

I feel this should be a simple property, but for the life of me I've searched and cannot find the answer. I have a tableview index to the right of my table. When selected, it grays out everything. I'd like to mimic the iPod app, whereby when the index itself is selected, it is semi-transparent (alpha of maybe .4f). Any ideas?

2022-01-19 02:39:48    分类:问答    iphone   objective-c   ios   uitableview

Is that possible to create multiple cells in one xib?

I found it can create different cells with different xibs, but I want to know is possible to create different cell in one xib? If possible, what should I can do this? Here is the code, I know it is wrong code, so can you guys help me to fix it? - (void)viewDidLoad { [super viewDidLoad]; [imageTableView registerNib:[UINib nibWithNibName:@"ImageTableViewCell" bundle:nil] forCellReuseIdentifier:@"oneImageTableViewCell"]; [imageTableView registerNib:[UINib nibWithNibName:@"ImageTableViewCell" bundle:nil] forCellReuseIdentifier:@"twoImageTableViewCell"]; } - (UITableViewCell *)tableView

2022-01-19 02:20:03    分类:问答    ios   objective-c   uitableview

How to set UITableView empty space's backgroundColor different?

Here is a tableView with 5 cells and one section. there is a blue gap when pulling the tableView to refresh. here is the code: - (UITableView *)salesRankTableView{ if(!_salesRankTableView){ _salesRankTableView = [[UITableView alloc] initWithFrame: CGRectMake(8, 183, KScreenWidth - 16, KScreenHeight-183-64) style: UITableViewStyleGrouped]; [_salesRankTableView registerNib: [UINib nibWithNibName: NSStringFromClass(SalesRankTableViewCell.class) bundle:nil] forCellReuseIdentifier: kSalesRankTableViewCell]; _salesRankTableView.layer.contents = (__bridge id _Nullable)([UIImage imageNamed: @"blue"]

2022-01-19 02:00:00    分类:问答    ios   objective-c   uitableview

UITableView in UIView in UIScrollView. When scrolling tableview don't scroll scrollview too

I have a UITableView inside a UIView inside a UIScrollView. Problem: when i scroll/drag the tableview, the scrollview scrolls too. What i need is for the tableview not to pass the scroll to the scrollview. Also i need to be able to use the scrollview when i scroll it directly. How can i do this? Cheers

2022-01-18 23:55:15    分类:问答    uitableview   uiview   ios6   uiscrollview

Showing a checkmark accessory view move the table contents

I followed Apple's documentation on adding subview to the UITableViewcell here to add a 3rd label to the cell. The problem is when I show the standard checkmark accessory view on the right the whole cell contents moves left even when I didn't show the 3rd label. Screenshot below . And here is my code: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"MyCell"; UILabel *mainLabel, *secondLabel, *thirdLabel; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell ==

2022-01-18 22:39:55    分类:问答    ios   uitableview   custom-cell

Handle button click inside UITableViewCell

I can't seem to handle a button click properly inside a custom UITableViewCell. It's a cell that contains a label and a button. I have the following code: var cell = tableView.DequeueReusableCell (cellKey) as ApptHistoryCell; if (cell == null) { cell = _container.Cell; cell.SelectionStyle = UITableViewCellSelectionStyle.None; } if (InfoClicked != null) { cell.ActionButton.TouchUpInside += InfoClicked; } InfoClicked is an event handler passed on in loop on cell creation. When the cell is re-used, this causes a null reference exception, because (I think) TouchUpInside is trying to call 2

2022-01-18 22:35:56    分类:问答    ios   uitableview   xamarin.ios

how to set horizontal scrolling in UITableView by using interface builder?

I have UITableView in my app with 2 columns.I can read column 1 and half of column 2.My questions are- can we add horizontal scroll by use of interface builder in uitableview so i can read column 2 for all cells in table? should we have to add some code for that too or its only possible with interface builder?

2022-01-18 18:46:03    分类:问答    iphone   uitableview   interface-builder   uiscrollview   horizontal-scrolling

[UIView _forgetDependentConstraint:]: message sent to deallocated instance

I tried using NSZobie and all others. Still i face issues. can't able to find where app crashed. Please Help. thanks in advance. *** -[UIView _forgetDependentConstraint:]: message sent to deallocated instance 0x208e0010 (lldb) bt * thread #1: tid = 0x2503, 0x342b3468 CoreFoundation`___forwarding___ + 192, stop reason = EXC_BREAKPOINT (code=EXC_ARM_B`enter code here`REAKPOINT, subcode=0xdefe) frame #0: 0x342b3468 CoreFoundation`___forwarding___ + 192 frame #1: 0x3420af68 CoreFoundation`__forwarding_prep_0___ + 24 frame #2: 0x364f24ba UIKit`_updateViewDependenciesForConstraint + 202 frame #3

2022-01-18 12:33:10    分类:问答    ios   uitableview   autolayout

viewForHeaderInSection disappears when scrolling

I am using a custom header view in my UITableView, but as soon as i begin scrolling down the header disappears instead of staying in place like with the default headers. And it's not scrolling off the screen either, just completely disappering. viewForHeaderInSection is still being called but the drawRect method of my custom header view isn't. What am I doing wrong? Here's some code... My UITableView datasource... - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { HeaderView* headerView = [[[HeaderView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f

2022-01-18 12:23:36    分类:问答    ios   objective-c   iphone   uitableview   cocoa-touch