Jump to content

- - - - -

Attributes in custom view cells not editable?

  • Please log in to reply
No replies to this topic

#1 notreallyme


    Experienced Member

  • STV 5.0 Pro
  • PipPipPipPip
  • 82 posts
Reputation: 8

Posted 29 December 2013 - 04:47 AM

I wanted to comply the task to have a cell with a editable value and a unit-name behind the value. I learned that it is necessary to do this via a custom cell, as there is no way to add a unit text behind the value in the STV standard cells. So i created a nib-file and also supplied an attribute for the unit in the database. The code looks like this then:



    SCPropertyDefinition *limitPropertyDef = [alarmDefinitionDef
    limitPropertyDef.type = SCPropertyTypeCustom;
    limitPropertyDef.title = @"Limit";
    limitPropertyDef.uiElementNibName = @"WarningAmountCell";
    limitPropertyDef.objectBindingsString = @"1:limit;2:unit";

So what happens when i put this to action? The cell is drawn correctly and the values for "limit" and "unit" are presented with the content already present in the database. But when i tap on the value, only the complete cell is selected (changes to grey background color) and the value is not edited, nothing else happens. I also changed this to one attribute alone (limit), because i would anyway need a way to tell STV that the unit is not editable in this cell by the user. I could live with this workaround and prepare a set of nib-files with the different possible units as fixed text in it, but this also did not work, the limit-value is not editable.


So the question is: Is it possible to use custom view cells with editable content in it? If not, how do you add units to the standard value cells or rearrange them (the value is aligned afar to the left by default) the way you need it?


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users