Skip to content

Instantly share code, notes, and snippets.

@NoelOConnell
Last active March 4, 2016 21:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NoelOConnell/7ae03cbe137b0b42edf1 to your computer and use it in GitHub Desktop.
Save NoelOConnell/7ae03cbe137b0b42edf1 to your computer and use it in GitHub Desktop.
NativeScript margin not taking effect on Android
SearchBar {
background-color: white;
margin: 8;
}
GridLayout {
margin: 7;
}
.wrapper {
background-color: #eaedee;
}
.list-item {
background-color: white;
padding:10;
margin-bottom: 20;
}
.list-title {
font-weight: bold;
font-size: 14;
color: black;
}
.list-subtitle {
font-size: 12;
}
<GridLayout rows="auto, *" columns="*" backgroundColor="#eaedee" id="gridLayout">
<SearchBar col="1" row="0" text="{{ search }}" hint="Search" id="search" returnPress="searchForJobs" />
<ListView items="{{ candidateList }}" id="candidateList" row="1" colSpan="2" itemTap="viewJob" loadMoreItems="loadMoreCandidates">
<ListView.itemTemplate>
<GridLayout columns="*, auto" rows="auto, auto, auto, auto" cssClass="list-item">
<Label row="0" text="{{ firstName + ' ' + lastName }}" cssClass="list-title" />
<Label row="1" text="{{ currentTitle + ' at ' + currentCompany }}" cssClass="list-subtitle"/>
<Label row="2" text="{{ jobTitle }}" cssClass="list-subtitle"/>
<Label row="3" text="{{ status }}" cssClass="{{ 'list-subtitle ' + statusClass}}"/>
<Label col="1" row="0" text="{{ dateApplied }}" cssClass="list-subtitle"/>
</GridLayout>
</ListView.itemTemplate>
</ListView>
<ActivityIndicator busy="{{ isLoading }}" rowSpan="2" colSpan="2" width="50" height="50" />
</GridLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment