Tasvirda ko'rsatilgandek tartibni qanday yaratish kerak

enter image description here

i am using linear layout with weight but it is not looking consistent on different screen sizes(only handsets). i need the text should be exactly below the image icon. so is there any way to create this layout in android here is my xml code


            
                
                
                
                
                
                
                
                
                
                
                
            
            
                
                
                
                
                
                
                
                
                
            
 
0
Uning bosqichma-bosqich rivojlanish ko'rsatkichi. Buning uchun kutubxona mavjud.
qo'shib qo'ydi muallif Piyush, manba
Mizanpajingiz nimani ko'rsatganini bizga ko'rsata olasizmi?
qo'shib qo'ydi muallif Vinnie, manba
@sunilkushwah hal qilindi?
qo'shib qo'ydi muallif Aditya Vyas-Lakhan, manba
@Piyush: Men bitta kutubxonani topdim, ammo kutubxonadagi ishlanmaning ko'rsatkichi menikidan farq qiladi.
qo'shib qo'ydi muallif sunil kushwah, manba
@Aditya Vyas-Lakhan: hali emas.
qo'shib qo'ydi muallif sunil kushwah, manba

6 javoblar

Matn sizning rasmlaringiz bilan sinxronlashdan chiqsa, har bir komponent uchun vertikal LinearLayout (tasvir va matn) uchun foydalanishga harakat qilib ko'rishingiz mumkin.

Shuning uchun ichida 5 vertikal LinearLayouts bilan bir katta gorizontal LinearLayout foydalaning . Endi sizlar kabi ikki gorizontal LinearLayouts o'rniga.

Boshqa variant sifatida siz buni ConstraintLayout yordamida tuzishga harakat qilishingiz mumkin. U sizlarni sinxronlashdan tashqariga chiqarmaydigan narsalarni moslashtirishga imkon beradi.

noreferrer"> https://developer.android.com/training/constraint-layout/index. html

2
qo'shib qo'ydi
Ularni ikkalasini qo'yishingiz mumkin. Shunday qilib, ular orasida 4 qatorli 5 vertikal LinearLayouts bo'lishi mumkin.
qo'shib qo'ydi muallif Michael Vescovo, manba
Matn juda keng bo'lganligi sababli ularni teginish qiyin bo'lsa, siz chiziqni hamma orqasiga qo'yishingiz va tasvirlar oldingizda o'tirishingiz mumkin. Shunday qilib, FrameLayout dan foydalaning, keyin uning ustiga katta katta chiziq qo'ying, keyin katta gorizontal LinearLayout ni joylashtiring.
qo'shib qo'ydi muallif Michael Vescovo, manba
@Michale Vescovo: tasvir piktogramlarini bog'lovchi chiziq haqida
qo'shib qo'ydi muallif sunil kushwah, manba
bu yondashuvda birinchi navbatda biz qanday qilib bu yo'nalishni qanday joylashtirmoqdamiz, ikkinchisida tasvir ikonkasiga tegmaslik kerak, chunki rasm ikonkasi va chiziq o'rtasida vertikal chiziqli tartib mavjud.
qo'shib qo'ydi muallif sunil kushwah, manba

Natijada siz kutubxonani sinab ko'ring

noreferrer"> https://github.com/baoyachi/StepView

https://github.com/anton46/Android-StepsView

https://github.com/ol107/material-range-bar

Java kodi

HorizontalStepView setpview5 = (HorizontalStepView) mView.findViewById(R.id.step_view5);
        List stepsBeanList = new ArrayList<>();
        StepBean stepBean0 = new StepBean("接单",1);
        StepBean stepBean1 = new StepBean("打包",1);
        StepBean stepBean2 = new StepBean("出发",1);
        StepBean stepBean3 = new StepBean("送单",0);
        StepBean stepBean4 = new StepBean("完成",-1);
        stepsBeanList.add(stepBean0);
        stepsBeanList.add(stepBean1);
        stepsBeanList.add(stepBean2);
        stepsBeanList.add(stepBean3);
        stepsBeanList.add(stepBean4);


        setpview5
                .setStepViewTexts(stepsBeanList)//总步骤
                .setTextSize(12)//set textSize
                .setStepsViewIndicatorCompletedLineColor(ContextCompat.getColor(getActivity(), android.R.color.white))//设置StepsViewIndicator完成线的颜色
                .setStepsViewIndicatorUnCompletedLineColor(ContextCompat.getColor(getActivity(), R.color.uncompleted_text_color))//设置StepsViewIndicator未完成线的颜色
                .setStepViewComplectedTextColor(ContextCompat.getColor(getActivity(), android.R.color.white))//设置StepsView text完成线的颜色
                .setStepViewUnComplectedTextColor(ContextCompat.getColor(getActivity(), R.color.uncompleted_text_color))//设置StepsView text未完成线的颜色
                .setStepsViewIndicatorCompleteIcon(ContextCompat.getDrawable(getActivity(), R.drawable.complted))//设置StepsViewIndicator CompleteIcon
                .setStepsViewIndicatorDefaultIcon(ContextCompat.getDrawable(getActivity(), R.drawable.default_icon))//设置StepsViewIndicator DefaultIcon
                .setStepsViewIndicatorAttentionIcon(ContextCompat.getDrawable(getActivity(), R.drawable.attention));//设置StepsViewIndicator AttentionIcon

Chiqish

enter image description here

0
qo'shib qo'ydi

LinearLayout'dan orientation: gorizontal bilan foydalanishni tavsiya qilamiz va keyin har bir progressiv uchun alohida RelativeLayouts qo'yasiz. RelativeLayout ni taklif qilmoqchiman, chunki siz matnli yoki tasavvurlaringizni moslashtirish uchun android: layout_toLeftOf kabi joylashtiruvchi teglardan foydalanishingiz mumkin.

0
qo'shib qo'ydi

Bu erda mening savolim hal qilindi, men bu uchun cheklov tartibidan foydalanardim

<?xml version="1.0" encoding="utf-8"?>



    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    



0
qo'shib qo'ydi
try to do like this : 

    <?xml version="1.0" encoding="utf-8"?>

    enter code here



    

        

            

            

        


        

            

            


        


        

            

            


        



    

[layout should look like this ][1]


  [1]: https://i.stack.imgur.com/lim80.png
0
qo'shib qo'ydi
fikrlarni birlashtiradigan chiziq qaerda
qo'shib qo'ydi muallif sunil kushwah, manba
Ichki chiziqli jadvallar orasidagi kerakli ko'rinishni qo'shing yoki ushbu tartibni ketma-ketlikda ketma-ket keladigan ketma-ketlik uchun tegishli tartibni ota-onadan foydalaning
qo'shib qo'ydi muallif anil, manba

Sizning talabingiz bo'yicha shunga o'xshash tarzda foydalanishingiz mumkin.




    
    



    
    

0
qo'shib qo'ydi