Android learning notes, android learning materials
The story is like this, because the company currently has a mobile sign detection product that needs to be connected to the Internet. The Department has only one mobile developer, and the others are C # developers. The customer is ye! Just as I was helpless, this guy told me this new Android player to help him. No way. I am the old guy, too. The guy walked along with my oil bottle and wrote a bit about his project.
1. You cannot add uppercase characters to the image name in android studio. Otherwise, an error is reported during compilation.
2. When TabLayout is written in XML format, the Code is as follows. Note the following:
<TabHost android: id = "@ + id/main_tabHost" android: layout_width = "match_parent" android: layout_height = "match_parent"> <LinearLayout android: layout_width = "fill_parent" android: layout_height = "fill_parent" android: orientation = "vertical"> <! -- The id attribute of TabWidget must be @ android: id/tabs --> <TabWidget android: id = "@ android: id/tabs" android: layout_width = "match_parent" android: layout_height = "wrap_content" android: layout_weight = "0" android: orientation = "horizontal"/> <! -- The id attribute of FrameLayout must be @ android: id/tabcontent --> <FrameLayout android: id = "@ android: id/tabcontent" android: layout_width = "match_parent" android: layout_height = "match_parent" android: layout_weight = "0"> <ImageView android: id = "@ + id/tab1" android: layout_width = "fill_parent" android: layout_height = "wrap_content" android: src = "@ drawable/sample"/> <ImageView android: id = "@ + id/tab2" android: layout_width = "wrap_content" android: layout_height = "fill_parent" android: src = "@ drawable/new_patient"/> <ImageView android: id = "@ + id/tab3" android: layout_width = "wrap_content" android: layout_height = "fill_parent" android: src = "@ drawable/cases"/> <ImageView android: id = "@ + id/tab4" android: layout_width = "wrap_content" android: layout_height = "fill_parent" android: src = "@ drawable/config1"/> </FrameLayout> </LinearLayout> </TabHost>
Continue .........