Comments (6)
Could you please show the code of your cell ?
from promotion-xlform.
Sure - I tried a couple of ways - first as your docs showed, then trying to get the redraw via the value, seeing if applying style would fix it:
https://gist.github.com/grimmwerks/3a7348784c36d49aa9229aee497b1be6
https://gist.github.com/grimmwerks/8ec8ec0f7adc5efb582983ab7da87ac5
a video showing the issue: https://www.dropbox.com/s/e1ty94asqr8caye/straps_redraw.mp4?dl=0
REALLY appreciate the assist; if it's something really stupid I'm doing.
from promotion-xlform.
...also very curious if you can create your own class for a section, or at least add buttons in a footer of a section. I'm sure at worst I could just use a cell for one item to add buttons to manipulate other areas but still curious.
from promotion-xlform.
Thanks for jumping in on slack; Mark's example was fantastic; just for others I'm pasting in what seems to work for me (which is exactly what you have in the docs; I'm unsure why it was a problem for me to begin with):
class StrapCell < PM::XLFormCell
attr_accessor :position, :tension, :name
attr_accessor :strap_name, :strap_position, :strap_tension
include StrapCellStylesheet
def initWithStyle(style, reuseIdentifier: reuse_identifier)
super.tap do
create_cell_items
end
end
def create_cell_items
@strap_image ||= append!(UIImageView, :strap_image)
@strap_name ||= append!(UILabel, :strap_name)
@strap_position ||= append!(UILabel, :strap_position)
@strap_tension ||= append!(UILabel, :strap_tension)
apply_style :strap_cell
end
def update
super
self.data_cell ||={}
# create_cell_items
@strap_name.text = value[:strap]
@strap_position.text = "Position: #{value[:position]}"
@strap_tension.text = "Tension: #{value[:tension]}"
end
end
from promotion-xlform.
@grimmwerks Glad to hear that.
Could I ask you to PR a section on the doc for cells when using RedPotion ?
from promotion-xlform.
Sure thing; I'm going to be doing a number of different custom cells / styling sections, so once I figure out a few things I definitely will!
from promotion-xlform.
Related Issues (20)
- Table cell constraints working at first then failing.
- Textarea vs textview - no error messaging. HOT 1
- XLFormScreen background_color HOT 1
- Dynamic options for :selector_push type HOT 1
- Question: How do I create a picker with Items to select from? HOT 2
- Button Doesn't Appear HOT 5
- Create custom cell HOT 1
- localizing buttons actions HOT 2
- Styling the form with rmq HOT 5
- can't convert Class into String after newclear HOT 5
- multiple_selector and multiple_selector_popover don't seem to be working now. HOT 2
- Question: Is it possible to set a default value for :multiple_selector row types? HOT 1
- Keep hitting into NameError uninitialized constant ProMotion::XLForm::XLFormRowDescriptorTypeImage HOT 2
- insert_mode :last_row or :button no longer works? HOT 1
- form_options question HOT 1
- Is it possible to add grouped selector_alert_view ?
- Possible to make link clickable inside textview? HOT 2
- appearance is not working when adding on type text field
- Error when using use_frameworks!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from promotion-xlform.