55 </ActionBar >
66 <GridLayout colums =" *" rows =" *" >
77 <Button class =" btn btn-primary m-t-20" ref =" btn" text =" 触摸" @tap =" touch" />
8+ <!-- <Button class="btn btn-primary m-t-20" ref="btn" text="触摸" /> -->
89 </GridLayout >
910 </Page >
1011</template >
@@ -21,27 +22,34 @@ export default {
2122 };
2223 },
2324 mounted () {
25+ // this.touch();
26+ // let btn = this.$refs.btn.nativeView;
27+ // btn.ios.setTitleColorForState(new Color('red').ios,UIControlStateSelected);
2428 },
2529 methods: {
2630 touch : function () {
27- var colorModule = require (" color" );
28- var red = new colorModule.Color (" #ff0000" );
31+ // var colorModule = require("color");
32+ // var red = new colorModule.Color("#ff0000");
2933 let btn = this .$refs .btn .nativeView ;
3034 console .log (' xxxx' , btn .ios );
3135 // 设置button按钮文字
3236 btn .ios .setTitleForState (' Button title' , UIControlStateNormal);
3337 // var UIButton = UIButton.alloc.init;
3438 // btn.ios.frame = CGRectMake(5, 5, 5, 5)
35- // btn.ios.showsTouchWhenHighlighted = 'YES';
39+ btn .ios .showsTouchWhenHighlighted = ' YES' ;
3640 // btn.ios.ButtonType = 'custom';
3741 // btn.ios.setTitleColor = new Color('red');
3842 btn .ios .setTitleColorForState (new Color (' red' ).ios ,UIControlStateNormal);
43+ btn .ios .setTitleShadowColorForState (new Color (' red' ).ios ,UIControlStateNormal);
44+ btn .ios .reversesTitleShadowWhenHighlighted = true ;
45+ btn .ios .setShadowOpacity = 0.5 ;
46+ // btn.ios.setBorderWidth(3);
47+ btn .ios .layer .setBorderColor (new Color (' red' ).ios );
48+
3949 let title = btn .ios .currentTitle ;
4050 console .log (' 标题' , title);
41- let titleColor = btn .ios .currentTitleColor
42- ;
51+ let titleColor = btn .ios .currentTitleColor ;
4352 console .log (' 标题颜色' , titleColor);
44- ;
4553 // [button addTarget: self action:@selector(touchDownAction) forControlEvents: UIControlEventTouchDown];
4654
4755 // [self.view addSubview: button];
0 commit comments