Hello,
I would like to put a TDPFSwitch into a TDPFUITableView Cell.
Is this possible.
I am able to place on on the table view, but it does not seem to be tied to a cell.
Maybe I should use some other control?
Thanks for any advice.
Regards,
Bryan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello Babak,
Thank you for your reply, but when I implement OnDrawCell, It will not compile because the compiler does not recognize "TTableItem". It shows undeclared identifier.
Hi Babak,
I was able to see the demo and modify it to add a switch. Thanks for the example.
But when I try to set the switch alignment, it will not accept alRight. Compiler says undeclared identifier 'alRight'
I am still having trouble with adding a switch. I am able to do it with your demo app, but in my app it will not work.
I have a TableView with 3 different sections. I only want to add the TDPFSwitch to the table items in section 1.
The TableItems in section 1 already have a an item description and item text set to what I want in design time (2 Objects).
I've added the code below to only add the TDPFSwitch to the Table Items in section 1, but when I run the app, it removes text from table items in section 0,1,2. and it still does not add the Switch.
Since there are only 2 objects in the TableItem in section 1 (ItemText and ItemDescription), I set the object length to 3 to add space for the switch.
Hi Babak,
I am able to put the switch in the TableView in the correct row, but there still seems to be a problem.
When I create the section in design view and make it Style tvscSubtitle, I get the main title and the subtitle, but when I run the app, the TableItem.ItemText.Text is wiped out, but the item description is still there.
To make a simple test of this, create a TableView in design time, with a table item style tvcsSubtitle, and set the ItemText and ItemDescription.
Next, add the method OnDrawCell, but just comment out the method code area.
I added Handled parameterfor this purpose,
Set Handled := false; when you want default draw (text, description) or
Set Handled := true; your own custom draw;
Regards
Last edit: Babak Yaghoobi 2014-02-09
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I would like to put a TDPFSwitch into a TDPFUITableView Cell.
Is this possible.
I am able to place on on the table view, but it does not seem to be tied to a cell.
Maybe I should use some other control?
Thanks for any advice.
Regards,
Bryan
Hi Bryan
You can add, create your TDPFSwitch in DrawCell event
Regards
Hello Babak,
Thank you for your reply, but when I implement OnDrawCell, It will not compile because the compiler does not recognize "TTableItem". It shows undeclared identifier.
procedure TfrmMain.tvSevereWeatherDrawCell(Sender: TObject; Section,
RowNo: Integer; TableItem: TTableItem;
var Objects: TArray<DPF.iOS.BaseControl.TDPFiOSBaseControl>);
Regards,
Bryan
Hi Bryan
Add DPF.iOS.UITableViewItems into your uses list.
regards
Thank you.
Hello Babak,
I've tried to do this, but I just don't know how...
Can you give me a little help :-)
Hi Bryan
Download last source [code] and see [TableViewCustomView] Demo.
Regards
Related
Code: code
Hi Babak,
I was able to see the demo and modify it to add a switch. Thanks for the example.
But when I try to set the switch alignment, it will not accept alRight. Compiler says undeclared identifier 'alRight'
Cheers,
Bryan
Hi Bryan
don't use alignment for cell components, it's better set position manually,
for alRight:
regards
Hi Babak,
Thank you for the advice.
I am still having trouble with adding a switch. I am able to do it with your demo app, but in my app it will not work.
I have a TableView with 3 different sections. I only want to add the TDPFSwitch to the table items in section 1.
The TableItems in section 1 already have a an item description and item text set to what I want in design time (2 Objects).
I've added the code below to only add the TDPFSwitch to the Table Items in section 1, but when I run the app, it removes text from table items in section 0,1,2. and it still does not add the Switch.
Since there are only 2 objects in the TableItem in section 1 (ItemText and ItemDescription), I set the object length to 3 to add space for the switch.
This is the code i'm using:
Just in case it is hard to understand what I am talking about I've added my sample shell of an app to this post.
On another note, it appears the TDPFMapView is overlapping the toolbar at the top and there is a space at the bottom of the app.
Any suggestions?
Many thanks for your hard work on this component set. It is truly amazing.
Sorry for all the questions, I am new to iOS programming.
Kind Regards,
Bryan
Last edit: Bryan 2014-02-09
Hi Bryan
Download last source [code] from SVN and see TableViewCustomViewSection Demo,
Regards
Related
Code: code
Hi Babak,
I am able to put the switch in the TableView in the correct row, but there still seems to be a problem.
When I create the section in design view and make it Style tvscSubtitle, I get the main title and the subtitle, but when I run the app, the TableItem.ItemText.Text is wiped out, but the item description is still there.
To make a simple test of this, create a TableView in design time, with a table item style tvcsSubtitle, and set the ItemText and ItemDescription.
Next, add the method OnDrawCell, but just comment out the method code area.
Hi Bryan
I added Handled parameterfor this purpose,
Set Handled := false; when you want default draw (text, description) or
Set Handled := true; your own custom draw;
Regards
Last edit: Babak Yaghoobi 2014-02-09
Hi Babak,
So if I understand you correctly, I have to draw everything within a row if I add anything custom?
So if I want to add a switch, I have to manually (in code) make the ItemText and ItemDescription in code also?
Bryan
Hi Bryan
If you want to UITable draw default setting set Handled := false if you want to do not draw default setting Handled := true;
Now, if you want add a switch, and you have to manually make the itemText and iTemDescription set Handled := false;
Regards