学习练习--UI界面实现个人所得税计算

该博客展示了一个iOS应用中实现个人所得税计算的代码,包括工资输入、应缴税和实际工资的显示,并提供了计算和重置按钮。同时,博主探讨了UITextField的使用及其交互设置。
摘要由CSDN通过智能技术生成

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

{

    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    // Override point for customization after application launch.

    self.window.backgroundColor = [UIColor whiteColor];

    [self.window makeKeyAndVisible];

    

    UILabel *welcomLb = [[UILabel alloc]initWithFrame:CGRectMake(80, 20, 160, 50)];

    welcomLb.text = @"个人所得税计算";

    welcomLb.textColor = [UIColor greenColor];

    welcomLb.font =[UIFont boldSystemFontOfSize:22];

    welcomLb.shadowColor = [UIColor purpleColor];

    welcomLb.shadowOffset = CGSizeMake(2, 2);

    welcomLb.textAlignment = NSTextAlignmentCenter;

    [self.window addSubview:welcomLb];

    

    //输入工资

    UILabel *salaryLb = [[UILabel alloc]initWithFrame:CGRectMake(50, 70, 80, 40)];

    salaryLb.text = @"工资:";

    salaryLb.textAlignment = NSTextAlignmentLeft;

    [self.window addSubview:salaryLb];

    

    salaryTF = [[UITextField alloc]initWithFrame:CGRectMake(150, 70, 140, 40)];

    salaryTF.borderStyle = UITextBorderStyleRoundedRect;

    salaryTF.placeholder = @"请输入.......";

    salaryTF.keyboardType = UIKeyboardTypeNumberPad;

    [self.window addSubview:salaryTF];

    

    //个人所得税

    UILabel *taxOutLb = [[UILabel alloc]initWithFrame:CGRectMake(50, 110, 80, 40)];

    taxOutLb.textAlignment = NSTextAlignmentLeft;

    taxOutLb.text = @"应缴税:";

    [self.window addSubview:taxOutLb];

    

    taxOutTF = [[UITextField alloc]initWithFrame:CGRectMake(150, 110, 140, 40)];

    taxOutTF.userInteractionEnabled = NO;

    taxOutTF.borderStyle = UITextBorderStyleRoundedRect;

    taxOutTF.placeholder = @"应缴税......";

    [self.window addSubview:taxOutTF];

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值