Android 基礎標籤

來源:互聯網
上載者:User

標籤:http   迴圈   format   font   tps   ide   creat   迴圈滾動   single   

    TextView標籤

<TextView            android:text="我乃哈哈哈哈哈哈哈學習Androd"            android:textSize="25dp"            android:textColor="@android:color/holo_blue_dark"            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:singleLine="true"            />

text:顯示文本資訊
textSize:設定文字大小
textColor:設定文本顏色
singleLine:單行顯示
ellipsize:設定省略符號顯示的位置,預設是end(結尾) start(開頭) middle(中間)

 

 

<TextView            android:text="哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈啊哈哈啊哈哈哈哈哈哈"            android:textSize="25dp"            android:textColor="@android:color/holo_blue_dark"            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:singleLine="true"            android:ellipsize="marquee"            android:focusable="true"            android:focusableInTouchMode="true"            android:marqueeRepeatLimit="1"            />

android:singleLine="true"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:marqueeRepeatLimit  迴圈滾動次數(屬性值marquee_forever代表一直滾動)
android:marqueeRepeatLimit="5"

 

enabled:設定按鈕是否可以點擊
drawableTop:在按鈕文字上方加入圖片
drawableBottom
drawableLeft
drawableRight
drawableStart:國際化標準左
drawableEnd:國際化標準右

 

  <TextView                     android:text="QQ郵箱: [email protected]    電話: 15116964938   網站:  www.baidu.com"                     android:textSize="25dp"                     android:textColor="@android:color/holo_blue_dark"                     android:layout_width="wrap_content"                     android:layout_height="wrap_content"                     android:autoLink="all"                     />                        <Button                         android:text="這隻是個按鈕"                         android:textColor="@android:color/holo_green_light"                         android:textSize="30dp"                         android:enabled="false"                         android:drawableTop="@mipmap/ic_launcher"                         android:drawableRight="@mipmap/ic_launcher"                         android:drawableLeft="@mipmap/ic_launcher"                         android:drawableBottom="@mipmap/ic_launcher"                         android:layout_width="wrap_content"                         android:layout_height="wrap_content"                         />               <Button                   android:text="er"                   android:id="@+id/but01"                   android:layout_width="wrap_content"                   android:layout_height="wrap_content" />               <Button                   android:text="san"                   android:id="@+id/but02"                   android:layout_width="wrap_content"                   android:layout_height="wrap_content" />                 <TextView                     android:id="@+id/tvshow"                     android:layout_width="wrap_content"                     android:layout_height="wrap_content" />         

 

代碼

  @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.layout_textview);        View.OnClickListener click = new View.OnClickListener() {            @Override            public void onClick(View v) {                int id = v.getId();                switch (id) {                    case R.id.but01:                        tvshow = (TextView) findViewById(R.id.tvshow);                        tvshow.setText("我來啦一號");                        break;                    case R.id.but02:                        tvshow = (TextView) findViewById(R.id.tvshow);                        tvshow.setText("我來啦二號");                        break;                }            }        };        Button button = (Button) findViewById(R.id.but02);        Button button2 = (Button) findViewById(R.id.but01);        button.setOnClickListener(click);        button2.setOnClickListener(click);        // ATTENTION: This was auto-generated to implement the App Indexing API.        // See https://g.co/AppIndexing/AndroidStudio for more information.        client = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build();    }

 

 

Android 基礎標籤

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.