I want to create a custom calendar application using an array of buttons,so I want to know how to start with this..please help me out.w.r.t this,I want to know if any libraries are present which uses buttons and not a grid layout,because I dont want to use a grid layout
Hello friends,I tried to solve this issue with comments below and wrote this code
for (int columnIndex = 0; columnIndex < 6; columnIndex++)
{
// now loop over the rows
for (int rowIndex = 0; rowIndex < 7; rowIndex++)
{
NSString *buttonTitle = [NSString stringWithFormat:@"%d",columnIndex,rowIndex];
CGRect newFrame = CGRectMake(10 + rowIndex * 40, 60 + columnIndex * 40, 35, 35);
UIButton *newButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
newButton.frame = newFrame;
newButton.backgroundColor = [UIColor grayColor];
[newButton setTitle:buttonTitle forState:UIControlStateNormal];
[newButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
// tag the button, so we know how to handle each one
//newButton.tag = (columnIndex << 8) + rowIndex;
//newButton =[m_buttonArray objectAtIndex:rowIndex];
NSLog(@"%d",[m_buttonArray count]);
[newButton addTarget:self action:@selector(buttonPressed) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:newButton];
}
and when I run the project i see 6*7 grid of buttons.. but I am confused how shall I add these buttons to an array so that I can access w.r.t array,I think it requires a 2D array..so firends please help me out how shall I do this
Thanks&Regards Ranjit