return imageIDs.length;
}
//---returns the ID of an item--- public Object getItem(int position) {
return position;
}
//---returns the ID of an item--- public long getItemId(int position) { return position;
}
//---returns an ImageView view---
public View getView(int position, View convertView, ViewGroup parent) {
ImageView imageView = new ImageView(context); imageView.setImageResource(imageIDs[position]); imageView.setScaleType(ImageView.ScaleType.FIT_XY); imageView.setLayoutParams(new Gallery.LayoutParams(150, 120)); imageView.setBackgroundResource(itemBackground); return imageView;
}
}
}
main.xml
"1.0" encoding="utf-8"?>
"http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" >
"fill_parent" android:layout_height="wrap_content" android:text="Images of San Francisco" />
android:id="@+id/gallery1" android:layout_width="fill_parent"
android:layout_height="wrap_content" />
android:id="@+id/image1" android:layout_width="320px" android:layout_height="250px" android:scaleType="fitXY" />
|
attrs.xml
"1.0" encoding="utf-8"?>
"Gallery1">
"android:galleryItemBackground" />
Дастур натижаси
Назорат саволлари
Андроид тизимида фойдаланувчи интерфейсини яратишда қандай layout (қолип) лардан фойдаланилади
Ориентацияни “Anchoring”бошқариш усуои ва унинг асосий хусусиятини айтинг?
Ориентацияни “Resizingandrepositioning” бошқариш усуои ва унинг асосий хусусиятини айтинг?
List view ларга қайсилар киради ва уларнинг асосий вазифаси нима?
ImageButton ва Button нинг қандай фарқи мавжуд?
EditText компонентаси ҳолатини фақат махфийсўз (парол)киритишга мўлажаллаш учунEditText элементига қандай аттрибут қўшиш лозим?
CheckBox қиймати trueёкиfalse эканлигини текшириш учун CheckBox синфининг қандай методдан фойдаланилади?
Gallery нима учун ишлатилади ва Gallery синфининг қандай методлари мавжуд?
Gallery ва ImageView компоненталарини қандай фарқлаш мумкин?
BaseAdapter синфи нима учун ишлатилади?
BaseAdapter синфининг қандай абстракт методлари мажуд? 12. ListView ва GridView виджетларининг бир-биридан фарқи?
Context меню яратиш учун қандай методлардан фойдаланилади?
Option меню яратиш учун қандай методлардан фойдаланилади?
Фойдаланилган адабиётлар
“Beginning AndroidTM 4 Application Development”, by Wei-Meng Lee, printed at Radha Offset, Delhi in 2015, pages – 533. Chapter-2. Activities, fragments and Intents
“Beginning AndroidTM 4 Application Development”, by Wei-Meng Lee, printed at Radha Offset, Delhi in 2015, pages – 533. Chapter-3. Android User Interface
“Beginning AndroidTM 4 Application Development”, by Wei-Meng Lee, printed at Radha Offset, Delhi in 2015, pages – 533. Chapter-4. Designing your user interface with Views
Beginning AndroidTM 4 Application Development”, by Wei-Meng Lee, printed at Radha Offset, Delhi in 2015, pages – 533. Chapter-5. Displaying pictures and menus with views
“AndroidTM Application Development Cookbook”, by Wei-Meng Lee, printed at Sharda Offset Press, Delhi in 2015, pages – 385. Chapter-1.
Android Fundamentals
Do'stlaringiz bilan baham: |