Wednesday, 24 October 2012

Android to draw border at top or bottom of textview

package com.example.testscrollview;

import java.util.HashMap;

import java.util.Map;


import android.app.ActionBar.LayoutParams;
import android.app.Activity;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

public class MainActivity extends Activity {
    ImageView image ;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        TextView sample = (TextView) findViewById(R.id.textView1);
        sample.setText("hello test");

      sample.setBackgroundResource(R.layout.linesample);
      
    } 
}


Place this in layout folder

linesample.xml





<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
    <shape android:shape="line">
        <stroke android:width="1dp" android:color="#FFFF00" />
        <solid android:color="#00000000" />

        <padding android:top="25dp" />
      
       

    </shape>
</item>
</layer-list>

11 comments:

  1. Thank u sir...

    ReplyDelete
  2. I love your article.You can visit my website:forgot avast password

    ReplyDelete
  3. hi thanku so much sharing this infromation thanku so much
    cs executive
    freecseetvideolectures/

    ReplyDelete
  4. hi thanku so much this infromation thanku so much
    Wordpress
    milesweb-review

    ReplyDelete
  5. OctaFx Review : A Complete Introduction to Trading Methods and Applications with Concept, Tools, and Techniques for Understanding the Market is a complete course in technical market analysis that focuses on how to navigate the labyrinth of technical tools currently available to financial traders.

    ReplyDelete
  6. Your Fxtm Review Account Allows You To Login To Your Account In More Than 1 Country.

    ReplyDelete
  7. Oh my goodness! Impressive article dude! Thanks, PLease Check my article also.

    Latest Mod Apps and Games

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete

Pass a HashMap from Angular Client to Spring boot API

This example is for the case where fileData is very huge and in json format   let map = new Map<string, string>()      map.set(this.ge...