久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

android中TABS的圓角

Rounded corners for TABS in android(android中TABS的圓角)
本文介紹了android中TABS的圓角的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我想為我在我的應用程序中構建的選項卡實現圓角.到目前為止,我能夠想出這個

I want to achieve rounded corners for the tab that I've constructed in my application. So far I was able to come up with this

我希望我的圓角看起來像這樣.(我的編碼方式是只出現左右角,但是當狀態改變時,它看起來像上圖)

I would like my rounded corners to look as so. (I've coded it in such a way that only the right and left corners appear but when the states change it looks like the above image)

以下是我目前編寫的代碼.如何通過代碼實現正確的圓角?

Below is the code that I've written so far. How can I achieve proper rounded corners through code ?

選定的 TAB.XML

SELECTED TAB.XML

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
>
<corners
    android:topRightRadius="10dp"
    android:bottomLeftRadius="10dp"/>

<gradient
    android:startColor="#000" 
    android:endColor="#000"
    android:gradientRadius="400"
    android:angle="-270"/>

</shape>

未選擇的 TAB.XML

UNSELECTED TAB.XML

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
>
<gradient 
android:angle="90" 
android:startColor="#880f0f10" 
android:centerColor="#8858585a" 
android:endColor="#88a9a9a9"/>

 <corners
    android:topLeftRadius="10dp"
    android:bottomRightRadius="10dp"/>

</shape>

感謝您的回復!:)

推薦答案

我認為你應該使用 4 個形狀:

I think you should use 4 shapes:

  • 左鍵未選中

  • for left button not selected

選擇左鍵

右鍵未選擇

選擇右鍵

然后編寫選擇器用于 button 背景,請參見左側按鈕的示例(右側類似):

And then write selector to use for button background, see example for the left button (for the right just the similar):

<selector
    xmlns:android="http://schemas.android.com/apk/res/android">

<item android:state_selected="true">
<shape android:shape="rectangle">
  <corners
    android:topLeftRadius="10dp"
    android:bottomLeftRadius="10dp"/>
  <gradient
    android:startColor="#000"
    android:endColor="#000"
    android:gradientRadius="400"
    android:angle="-270"/>
</shape>
</item>

<item>
    <shape android:shape="rectangle">
      <gradient
        android:angle="90"
        android:startColor="#880f0f10"
        android:centerColor="#8858585a"
        android:endColor="#88a9a9a9"/>
   <corners
      android:topLeftRadius="10dp"
      android:bottomLeftRadius="10dp"/>
</shape>
</item></selector>

這篇關于android中TABS的圓角的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How to wrap text around components in a JTextPane?(如何在 JTextPane 中的組件周圍環繞文本?)
MyBatis, how to get the auto generated key of an insert? [MySql](MyBatis,如何獲取插入的自動生成密鑰?[MySql])
Inserting to Oracle Nested Table in Java(在 Java 中插入 Oracle 嵌套表)
Java: How to insert CLOB into oracle database(Java:如何將 CLOB 插入 oracle 數據庫)
Why does Spring-data-jdbc not save my Car object?(為什么 Spring-data-jdbc 不保存我的 Car 對象?)
Use threading to process file chunk by chunk(使用線程逐塊處理文件)
主站蜘蛛池模板: 国产三级视频在线播放 | 一级黄色片免费看 | 亚洲影院在线 | 中国一级毛片免费看 | 亚洲免费观看视频 | 久草视频在线播放 | 精品福利在线观看 | 午夜精品一区二区三区在线视频 | 国产香蕉av | 伦一理一级一a一片 | 看片黄全部免费 | 波多野吉衣一二三区乱码 | 天天操天天干天天操 | 国产一区二区日韩 | 亚洲精品国产精品国自产观看浪潮 | 欧美激情视频一区 | 欧美日韩亚洲天堂 | 国产欧美一区二区精品忘忧草 | 国产成人免费在线观看 | 中文一区二区 | 亚洲精品久久久久久久久久久 | 黄色录像一级片 | 夜夜操夜夜爽 | 特级毛片爽www免费版 | 久久久久国产精品夜夜夜夜夜 | 99精品网| 干干干操操操 | 9.1成人看片免费版 国产草草影院 | 国产一区二区三区视频在线 | 国产欧美精品 | 最新国产在线视频 | 日韩在线视频网站 | 国产精品成人在线 | 青草av在线 | 色香蕉网| 成年网站在线观看 | 日韩av资源 | 久久精品播放 | 日韩在线播放视频 | 欧美一级视频 | 精品国产区|