Skip to content
This repository has been archived by the owner on Jul 7, 2022. It is now read-only.

Help required implementing your nativescript-globalevents for Label #4

Open
venkateshsj opened this issue Mar 15, 2018 · 0 comments
Open

Comments

@venkateshsj
Copy link

Hi, Thank you for wanting to report an issue on this project!

If this is a bug report or feature request, awesome!

If you are asking for support, the issue will be closed with a gentle reminder that this is an open source repo with the full source.

Since this is a open source plugin, any and all support needs to be paid, you can contact me at [email protected].

Tell us about the problem

Please give me a good overview of the problem.

Visit the following URL,
https://discourse.nativescript.org/t/nativescript-hacks-here-are-mine-share-yours/3516

  1. The first hack is to center align text in a Label horizontally and vertically
  2. It works perfectly fine when written on an individual page
  3. I wanted to write it globally once so that by default for every Label in a page the text is center aligned vertically and horizontally
  4. I tried to use your plugin to achieve the same, it gives me error as "label.on is not a function".

I am new to NativeScript, so is it possible for you to help me solve this issue? I have also sent you an email on your ID mentioned above.

Which NativeScript version and platform does your issue occur on?

Please do a tns info on your project and paste the results here.

nativescript - 3.4.3 - Up to date
tns-core-modules - 3.4.1 - Up to date
tns-android - 3.4.2 - Up to date
tns-ios - 3.4.1 - Not installed

Any steps to duplicate?

Please list any steps or source code to duplicate the issue.

I added the following code in app.js,
require('nativescript-globalevents');

const label = require('ui/label').Label();
label.on('loadedEvent', function(event) {
if (event.object.android) {
event.object.android.setGravity(17);
}
});

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant