mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Button textWrap implemented
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import common = require("./button-common");
|
||||
import stateChanged = require("ui/core/control-state-change");
|
||||
import dependencyObservable = require("ui/core/dependency-observable");
|
||||
import proxy = require("ui/core/proxy");
|
||||
|
||||
class TapHandlerImpl extends NSObject {
|
||||
private _owner: WeakRef<Button>;
|
||||
@@ -24,6 +26,18 @@ class TapHandlerImpl extends NSObject {
|
||||
|
||||
global.moduleMerge(common, exports);
|
||||
|
||||
function onTextWrapPropertyChanged(data: dependencyObservable.PropertyChangeData) {
|
||||
var btn = <Button>data.object;
|
||||
if (!btn.ios) {
|
||||
return;
|
||||
}
|
||||
|
||||
btn.ios.titleLabel.lineBreakMode = data.newValue ? NSLineBreakMode.NSLineBreakByWordWrapping : 0;
|
||||
}
|
||||
|
||||
// register the setNativeValue callback
|
||||
(<proxy.PropertyMetadata>common.Button.textWrapProperty.metadata).onSetNativeValue = onTextWrapPropertyChanged;
|
||||
|
||||
export class Button extends common.Button {
|
||||
private _ios: UIButton;
|
||||
private _tapHandler: NSObject;
|
||||
|
||||
Reference in New Issue
Block a user