Masalan: yozuvli interfeys >> TextView


Download 13.39 Kb.
Sana21.11.2020
Hajmi13.39 Kb.
#149216
Bog'liq
one million uzbek coders qullanma


android developer da kurinishlar view deb nomlanadi

masalan:


yozuvli interfeys >> TextView <<

tugmachli interfes >>ButtenView<<

rasmli interfeys >>ImageView<<"

e'tibor bergan bulsak hamma suzlarni bosh harflari katta harflarda yozilyabdi

bu yozishni tuya yozish deb nomlanadi.

android studioda viewlarni yozishda ularni orasini ochib yozish mumkin emas!

android developer 8-darsi:

android: text="happy birthday"

android:layout_with="150dp"

android:layput_height="150"

android:background="@android:color/darker_groy"

>

mana shu dasrurni mavjud xatolarini topish:



android:text="happy birthday"

android:layout_with="150dp"

android:layout_height="150dp"

android:background="@android:color/darker_grey"

/>


android developer 9- darsi:

android:text="happy birthday"

android:layout_with="150dp"

android:layout_height="150dp"

android:background="@android:color/darker_grey"/>

yuqoridagi dasturdagi textni hajmini oshirsak bizz belgilagan 150x150 oynadan oshib ketib ayrim

so'zlari ikkinchi qatorga tushib qoladi bu esa kugili kurinishga kelib qoladi. biz buning oldini olish maqsadida

"wrap content" deb ataluvchi maxsus qiymat berish orqali bartaraf etamiz!

android:text="happy birthday"

android:layout_with="wrap_content" //textning eni

android:layout_height="wrap_content" //textning buyi

android:background="@android:color/darker_grey"

/>

ana endi matn view yangilanadi va matn ulchamiga mos oyna ochiladi



android developer 10-darsi: //matn hajmini uzgartirish;

matn hajmini uzgartiradigan bitta atribut bor:



android:text="happy birthday"

android:layout_with="wrap_content" //textning eni

android:layout_height="wrap_content" //textning buyi

android:background="@android:color/darker_grey"

android:textsize=”48sp” //bu qator biz yozgan textni hajmini uzgartiradi



/>

Sp ning kengaytmasi bu ixtiyoriy ulchov pixellari degani! U dasturni turli zichlikdagi turli qurulmalar uchun mos kurinishga keltirib beradigan dp ga uxshash o’lchov birligi . u faqatgina fonlar uchun ishlatiladi, chunki u foydalanuvchining matn uchun sozlashlari va afzalliklariga qarab moslashtiriladi.

Download 13.39 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling