English 中文(简体)
图2
原标题:Centering 2 Textviews in LinearLayout, text only shown when scrolling

I m试图把两条文字写成线性语言。 这一线索在另一处,附有一份清单。

I think my XML is pretty correct. I fill my textViews dynamically in my Adapterclass. XML:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" android:orientation="vertical">

    <LinearLayout
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:orientation="horizontal"
    android:gravity="center">

    <TextView android:layout_height="wrap_content" 
    android:id="@+id/atlVacaturesnummer"
    android:layout_width="wrap_content" 
    android:textColor="@color/Accent"
    android:text="x"
    />


    <TextView android:layout_height="wrap_content" 
    android:id="@+id/atlVacatures"
    android:layout_width="wrap_content" 
    android:text="y"
    />

    </LinearLayout>

    <ListView android:id="@+id/android:list" 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" 
    android:layout_weight="1"
    android:drawSelectorOnTop="false" />

    <TextView android:layout_height="fill_parent" 
    android:id="@+id/android:empty"
    android:layout_width="fill_parent" 
    android:text="Er zijn geen jobs die voldoen aan uw criteria..."
    android:gravity="center"/>

</LinearLayout>    

校服:

/*
 * Klasse VacatureAdapter
 */
private class VacatureAdapter extends ArrayAdapter<Vacature>{
    private ArrayList<Vacature> vacatures;


    public VacatureAdapter(Context context, int textViewResourceId, ArrayList<Vacature> vacatures){
        super(context, textViewResourceId, vacatures);
        this.vacatures = getArray();
        //System.out.println("Array vacatureadapter: " + v);
    }

    @Override
    public View getView(int position, View convertview, ViewGroup parent){

        View view = convertview;
        if(view==null){
            LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            view = vi.inflate(R.layout.vacature_list_item, null);
            //view.setBackgroundColor((position % 2) == 1? Color.LTGRAY: Color.WHITE);
        }

        TextView atlVacatures = (TextView)findViewById(R.id.atlVacatures);
            TextView atlVacaturesnr = (TextView)findViewById(R.id.atlVacaturesnummer);
            atlVacaturesnr.setText("" + arrVacatures.size());
            atlVacatures.setText(" jobs op maat gevonden!");

        Vacature vaca = vacatures.get(position);

        if(vaca != null){               
            TextView tvNaam = (TextView) view.findViewById(R.id.vacatureNaam);
            TextView tvWerkveld = (TextView) view.findViewById(R.id.vacatureWerkveld);
            TextView tvRegio = (TextView) view.findViewById(R.id.vacatureRegio);
        if(tvNaam != null){   





            tvNaam.setText(vaca.getTitel());
            if(tvWerkveld != null){
                tvWerkveld.setText("Werkveld: " + vaca.getWerkveld());
                if(tvRegio!=null){
                    tvRegio.setText("Regio: "+vaca.getRegio());
                }
            }
        }
        }
        return view;
    }
}

不容置疑的是,如果我的先辈们开车,他就会正确展示我的《冲锋枪》中的案文,如果主子停下来并填写我的《名单》,只显示我人数的一位数,而且当我显示我的人数,加上第二位文本意见时,他就坐下来了。 我不理解什么错误,或许有些法典需要一些地方?

最佳回答

在我辞退我的道歉之后,我用我可操作的方法把我的手法放在一边,从而解决了我的问题。 现在 它希望:

    private Runnable returnRes = new Runnable(){
    public void run(){
        if (arrVacatures.size() == 0){
            dialog.dismiss();
        }
        if(arrVacatures!=null && arrVacatures.size() > 0){
            adapter.notifyDataSetChanged();
            for(int i= 0; i< arrVacatures.size();i++){
                adapter.add(arrVacatures.get(i));
            }
            dialog.dismiss();


            TextView atlVacatures = (TextView)findViewById(R.id.atlVacatures);
            TextView atlVacaturesnr = (TextView)findViewById(R.id.atlVacaturesnummer);
            atlVacaturesnr.setText("" + arrVacatures.size());
            atlVacatures.setText(" jobs op maat gevonden!");

            adapter.notifyDataSetChanged();
        }
    }
};
问题回答

暂无回答




相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签