Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Styling not applied to header on iOS #14

Closed
lukeramsden opened this issue Apr 4, 2017 · 8 comments
Closed

Styling not applied to header on iOS #14

lukeramsden opened this issue Apr 4, 2017 · 8 comments

Comments

@lukeramsden
Copy link
Contributor

For some reason, none of the styles I'm putting on the class are actually being applied on iOS. It's applying to the text, but just not the header.

Here's my XML:

<accordion:Accordion items="{{ items }}" class="accordion" allowMultiple="false">
  <accordion:Accordion.headerTemplate>
    <StackLayout>
      <GridLayout rows="*" columns="2*, 2*, 2*, 20*, *" class="header">
        <StackLayout row="0" col="1" colSpan="3" class="header-bg" />
        <StackLayout row="0" col="0" colSpan="2" class="key-bg" verticalAlignment="middle">
          <Label text="{{ key }}" class="key" textWrap="false" />
        </StackLayout>
        <StackLayout row="0" col="2" colSpan="2" verticalAlignment="middle">
          <Label text="{{ title }}" class="title" textWrap="true" />
        </StackLayout>
      </GridLayout>
    </StackLayout>
  </accordion:Accordion.headerTemplate>
  <accordion:Accordion.itemTemplate>
    <Label text="{{ text }}" class="text" textWrap="true" />
  </accordion:Accordion.itemTemplate>
</accordion:Accordion>

and my CSS:

Page {
  background-color: #F3721F;
}

.header {
  margin: 10;
  margin-left: 0;
}

.header-bg {
  padding: 25, 5;
  background-color: #151515;
  border-color: #FFFFFF;
  border-width: 1;
}

.title {
  font-size: 16px;
  color: #FFFFFF;
  margin: 0, 10;
}

.key-bg {
  background-color: #F3721F;
  border-color: #FFFFFF;
  border-width: 1;
  border-radius: 50%;
  width: 35;
  height: 35;
  padding: 0;
  margin: 1;
}

.key {
  font-family: 'Montserrat';
  text-align: center;
  vertical-align: middle;
  color: #FFFFFF;
  font-size: 18px;
  margin-top: 1;
}

.text {
  border-top-color: #FFFFFF;
  border-top-width: 1;
  border-bottom-color: #FFFFFF;
  border-bottom-width: 1;
  color: #FFFFFF;
  padding: 10, 40;
  background-color: #151515;
  vertical-align: middle;
  horizontal-align: center;
}
@thegermin8er
Copy link

I have the same problem, did you solve it?

@lukeramsden
Copy link
Contributor Author

@thegermin8er Nope, ended up making my own accordion system with a repeater and nativescript-effects to toggle an item open or closed when tapped.

@triniwiz
Copy link
Owner

I'll look into this but styling works fine for me with both platforms the only difference is i use angular

@lukeramsden
Copy link
Contributor Author

Yeah this was NS 2 so it might be fixed now.

@triniwiz
Copy link
Owner

Ok well if you want to try again let me know :)

@thegermin8er
Copy link

@lukeramsden thanks for your answer and suggestion.

Hi triniwiz, I use angular also.

The problem I'm having is with the height of the header. It looks like the ng-template adds a wrapper layoutcontainer and the header is hidden behind the item wrapper.
How do I access the wrappers?

Also when I have a item open and scroll up, the header of that item stops at the top and blocking things beneath.

https://github.com/thegermin8er/nsng-accordion-test

@triniwiz
Copy link
Owner

triniwiz commented Sep 27, 2017 via email

@thegermin8er
Copy link

Ok, thank you

@triniwiz triniwiz mentioned this issue Oct 20, 2018
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants