Masalan: yozuvli interfeys >> TextView
Download 13.39 Kb.
|
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: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 matn hajmini uzgartiradigan bitta atribut bor: 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 Download 13.39 Kb. Do'stlaringiz bilan baham: |
ma'muriyatiga murojaat qiling