如何在android中更改gridview字体大小

时间:2014-01-30 13:18:49

标签: android gridview fonts size

如何更改android中的Gridview字体大小。我在android Gridview中绑定了一些值,但有些值是hide。如何更改Gridview字体大小。请告诉我。例如:

Loan Amount 10 10000000 10000,这是我的gridview值,但我得到了

Loan Am 10 100000 10000,

只有我这样才能这样。取而代之的是10000000值,我显示了100000这个数量,另外只显示了一半。请告诉解决方案。

这是我的完整布局

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:minWidth="10dp"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<GridView
    android:id="@+id/gridView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/textView9"
    android:layout_below="@+id/editText4"
    android:layout_marginLeft="0sp"
    android:layout_marginRight="0sp"
    android:layout_marginTop="31dp"
    android:paddingLeft="0dp"
    android:gravity="center_horizontal"
    android:minWidth="10dp"
    android:numColumns="4"
    android:stretchMode="columnWidth"
    android:textAlignment="inherit"
    android:ellipsize="marquee" >

</GridView>

我的主要活动:

URL jsonGRID = new URL("http://192.169.11.172/MobileService/Service1.svc/ApprovalDetails/"+spinner3.getSelectedItem().toString()+"/"+spinner1.getSelectedItem().toString()+"/"+val+"");
            URLConnection jcGRID = jsonGRID.openConnection();
            BufferedReader readerGRID = new BufferedReader(new InputStreamReader(jcGRID.getInputStream()));
            String lineGRID = readerGRID.readLine();
            JSONObject jsonResponseGRID = new JSONObject(lineGRID);
            String Result1GRID =jsonResponseGRID.getString("ApprovalDetailsByPrpslNOResult");
            JSONObject jsonResponse1GRID = new JSONObject(Result1GRID);
            String Result2GRID = jsonResponse1GRID.getString("UtilTable");
            String RemoveNullGRID=Result2GRID.replace(",null","");
            String RemoveLoanAMt=RemoveNullGRID.replace("LoanAmount","LnAmt");
           StringTokenizer tokGRID = new StringTokenizer(RemoveLoanAMt, "[[,\\]");
           String fldvalsGRID[]=new String[tokGRID.countTokens()]; 
           int J=0;
           while(tokGRID.hasMoreTokens())
              {
               fldvalsGRID[J]=tokGRID.nextToken().replace("\"", "");
                  J++;
              }

           grid = (GridView) findViewById(R.id.gridView1);
           View v = null;
            ArrayAdapter<String> adapter = new ArrayAdapter<String>(MainActivity.this, android.R.layout.simple_spinner_item, fldvalsGRID);

            grid.setAdapter(adapter);

0 个答案:

没有答案