how to set width which is equal to another widget on android

前端 未结 7 540
走了就别回头了
走了就别回头了 2021-02-03 19:27

I need to draw a horizontal line below a text field such that the width of the line equals the text width (not the width of the full screen).

In my app I have a textview

7条回答
  •  我寻月下人不归
    2021-02-03 19:59

    Use RelativeLayout and use these two attribute in horizontal line view

     android:layout_alignLeft="@+id/textView1"     android:layout_alignRight="@+id/textView1"
    
    
    
    
    
    
            
    
    
            
    
        
    

提交回复
热议问题