初學ui,這是我們的乙個練習題,看上去感覺很難,其實並不難,需要的**量也不是很多,思路縷清就很簡單,下面是乙個效果圖:
需要**和備註如下:
@end
self.window=[[uiwindow alloc]initwithframe:[uiscreen mainscreen].bounds];
self.window.backgroundcolor=[uicolor whitecolor];
self.window.rootviewcontroller=[[uiviewcontroller alloc]init];
[self.window makekeyandvisible];
for (int i=0; i<16; i++) else if ((i+j)%2!=0)
//第二種方法:用到了c語言中的知識
view.backgroundcolor=((i+j)%2) ? ([uicolor redcolor ]) : ([uicolor blackcolor] );
[self.window addsubview:view];}}
return yes;
}
編寫乙個簡單的shell
include include include include include include include include void getloginname void gethostname void getdir p printf s p int main char argv 32 char...
編寫乙個簡單的死鎖
public class dead lock1 class runnable1 implements runnable catch exception e class runnable2 implements runnable catch exception e obj1 和 obj2 都是屬於類的...
乙個簡單的makefile的編寫
標頭檔案 part.h cpp檔案 包含part.h part.cpp cpp檔案 包含part.h partmain.cpp makefile編寫如下 main partmain.o part.o g o main partmain.o part.o partmain.o partmain.cpp...